1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +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:
Tom Lane
2004-10-16 18:57:26 +00:00
parent 1c2de47746
commit fdd13f1568
6 changed files with 95 additions and 72 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.191 2004/10/04 21:52:14 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.192 2004/10/16 18:57:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1528,6 +1528,9 @@ CommitTransaction(void)
RESOURCE_RELEASE_BEFORE_LOCKS,
true, true);
/* Check we've released all buffer pins */
AtEOXact_Buffers(true);
/*
* Make catalog changes visible to all backends. This has to happen
* after relcache references are dropped (see comments for
@ -1684,6 +1687,7 @@ AbortTransaction(void)
ResourceOwnerRelease(TopTransactionResourceOwner,
RESOURCE_RELEASE_BEFORE_LOCKS,
false, true);
AtEOXact_Buffers(false);
AtEOXact_Inval(false);
smgrDoPendingDeletes(false);
ResourceOwnerRelease(TopTransactionResourceOwner,