mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Remove the CheckpointStartLock in favor of having backends show whether they
are in their commit critical sections via flags in the ProcArray. Checkpoint can watch the ProcArray to determine when it's safe to proceed. This is a considerably better solution to the original problem of race conditions between checkpoint and transaction commit: it speeds up commit, since there's one less lock to fool with, and it prevents the problem of checkpoint being delayed indefinitely when there's a constant flow of commits. Heikki, with some kibitzing from Tom.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.186 2007/03/07 13:35:03 alvherre Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.187 2007/04/03 16:34:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -259,6 +259,7 @@ InitProcess(void)
|
||||
/* databaseId and roleId will be filled in later */
|
||||
MyProc->databaseId = InvalidOid;
|
||||
MyProc->roleId = InvalidOid;
|
||||
MyProc->inCommit = false;
|
||||
MyProc->inVacuum = false;
|
||||
MyProc->isAutovacuum = IsAutoVacuumWorkerProcess();
|
||||
MyProc->lwWaiting = false;
|
||||
@@ -392,6 +393,7 @@ InitAuxiliaryProcess(void)
|
||||
MyProc->xmin = InvalidTransactionId;
|
||||
MyProc->databaseId = InvalidOid;
|
||||
MyProc->roleId = InvalidOid;
|
||||
MyProc->inCommit = false;
|
||||
MyProc->inVacuum = false;
|
||||
MyProc->isAutovacuum = IsAutoVacuumLauncherProcess(); /* is this needed? */
|
||||
MyProc->lwWaiting = false;
|
||||
|
||||
Reference in New Issue
Block a user