Give the ResourceOwner mechanism full responsibility for releasing buffer
Tom Lane <tgl@sss.pgh.pa.us>
Give the ResourceOwner mechanism full responsibility for releasing buffer pins at end of transaction, and reduce AtEOXact_Buffers to an Assert cross-check that this was done correctly. When not USE_ASSERT_CHECKING, AtEOXact_Buffers is a complete no-op. This gets rid of an O(NBuffers) bottleneck during transaction commit/abort, which recent testing has shown becomes significant above a few tens of thousands of shared buffers.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/xact.c | modified | +5 −1 |
| src/backend/storage/buffer/bufmgr.c | modified | +57 −18 |
| src/backend/storage/buffer/localbuf.c | modified | +4 −15 |
| src/backend/storage/lmgr/proc.c | modified | +3 −7 |
| src/backend/utils/resowner/resowner.c | modified | +23 −30 |
| src/include/storage/bufmgr.h | modified | +3 −1 |