pgsql: bufmgr: Add some more error checking [infrastructure] around pin

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: bufmgr: Add some more error checking [infrastructure] around pin
Date: 2023-04-05 17:45:48
Message-ID: E1pk7Cd-001WqB-0p@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

bufmgr: Add some more error checking [infrastructure] around pinning

This adds a few more assertions against a buffer being local in places we
don't expect, and extracts the check for a buffer being pinned exactly once
from LockBufferForCleanup() into its own function. Later commits will use this
function.

Reviewed-by: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Reviewed-by: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Discussion: http://postgr.es/m/419312fd-9255-078c-c3e3-f0525f911d7f@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/819b69a81d307e2ad8e9752cf062ebb57813960d

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 44 +++++++++++++++++++++++++++----------
src/include/storage/bufmgr.h | 1 +
2 files changed, 33 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tomas Vondra 2023-04-05 19:40:41 pgsql: pg_dump: Add support for zstd compression
Previous Message Andres Freund 2023-04-05 17:27:12 pgsql: Add smgrzeroextend(), FileZero(), FileFallocate()