mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Rearrange vacuum-related bits in PGPROC as a bitmask, to better support
having several of them. Add two more flags: whether the process is executing an ANALYZE, and whether a vacuum is for Xid wraparound (which is obviously only set by autovacuum). Sneakily move the worker's recently-acquired PostAuthDelay to a more useful place.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.194 2007/09/08 20:31:15 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.195 2007/10/24 20:55:36 alvherre Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -291,8 +291,9 @@ InitProcess(void)
|
||||
MyProc->databaseId = InvalidOid;
|
||||
MyProc->roleId = InvalidOid;
|
||||
MyProc->inCommit = false;
|
||||
MyProc->inVacuum = false;
|
||||
MyProc->isAutovacuum = IsAutoVacuumWorkerProcess();
|
||||
MyProc->vacuumFlags = 0;
|
||||
if (IsAutoVacuumWorkerProcess())
|
||||
MyProc->vacuumFlags |= PROC_IS_AUTOVACUUM;
|
||||
MyProc->lwWaiting = false;
|
||||
MyProc->lwExclusive = false;
|
||||
MyProc->lwWaitLink = NULL;
|
||||
@ -429,8 +430,8 @@ InitAuxiliaryProcess(void)
|
||||
MyProc->databaseId = InvalidOid;
|
||||
MyProc->roleId = InvalidOid;
|
||||
MyProc->inCommit = false;
|
||||
MyProc->inVacuum = false;
|
||||
MyProc->isAutovacuum = IsAutoVacuumLauncherProcess(); /* is this needed? */
|
||||
/* we don't set the "is autovacuum" flag in the launcher */
|
||||
MyProc->vacuumFlags = 0;
|
||||
MyProc->lwWaiting = false;
|
||||
MyProc->lwExclusive = false;
|
||||
MyProc->lwWaitLink = NULL;
|
||||
|
Reference in New Issue
Block a user