mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
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.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.154 2004/09/29 15:15:55 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.155 2004/10/16 18:57:24 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -461,9 +461,7 @@ ProcKill(int code, Datum arg)
|
||||
* shutdown callback registered by the bufmgr ... but we must do this
|
||||
* *after* LWLockReleaseAll and *before* zapping MyProc.
|
||||
*/
|
||||
AbortBufferIO();
|
||||
UnlockBuffers();
|
||||
AtEOXact_Buffers(false);
|
||||
AtProcExit_Buffers();
|
||||
|
||||
/* Get off any wait queue I might be on */
|
||||
LockWaitCancel();
|
||||
@ -509,9 +507,7 @@ DummyProcKill(int code, Datum arg)
|
||||
LWLockReleaseAll();
|
||||
|
||||
/* Release buffer locks and pins, too */
|
||||
AbortBufferIO();
|
||||
UnlockBuffers();
|
||||
AtEOXact_Buffers(false);
|
||||
AtProcExit_Buffers();
|
||||
|
||||
/* I can't be on regular lock queues, so needn't check */
|
||||
|
||||
|
Reference in New Issue
Block a user