@@ -488,13 +488,13 @@ ProcArrayAdd(PGPROC *proc)
488488 (arrayP -> numProcs - index ) * sizeof (* ProcGlobal -> xids ));
489489 memmove (& ProcGlobal -> subxidStates [index + 1 ], & ProcGlobal -> subxidStates [index ],
490490 (arrayP -> numProcs - index ) * sizeof (* ProcGlobal -> subxidStates ));
491- memmove (& ProcGlobal -> vacuumFlags [index + 1 ], & ProcGlobal -> vacuumFlags [index ],
492- (arrayP -> numProcs - index ) * sizeof (* ProcGlobal -> vacuumFlags ));
491+ memmove (& ProcGlobal -> statusFlags [index + 1 ], & ProcGlobal -> statusFlags [index ],
492+ (arrayP -> numProcs - index ) * sizeof (* ProcGlobal -> statusFlags ));
493493
494494 arrayP -> pgprocnos [index ] = proc -> pgprocno ;
495495 ProcGlobal -> xids [index ] = proc -> xid ;
496496 ProcGlobal -> subxidStates [index ] = proc -> subxidStatus ;
497- ProcGlobal -> vacuumFlags [index ] = proc -> vacuumFlags ;
497+ ProcGlobal -> statusFlags [index ] = proc -> statusFlags ;
498498
499499 arrayP -> numProcs ++ ;
500500
@@ -562,7 +562,7 @@ ProcArrayRemove(PGPROC *proc, TransactionId latestXid)
562562 Assert (TransactionIdIsValid (ProcGlobal -> xids [proc -> pgxactoff ] == 0 ));
563563 Assert (TransactionIdIsValid (ProcGlobal -> subxidStates [proc -> pgxactoff ].count == 0 ));
564564 Assert (TransactionIdIsValid (ProcGlobal -> subxidStates [proc -> pgxactoff ].overflowed == false));
565- ProcGlobal -> vacuumFlags [proc -> pgxactoff ] = 0 ;
565+ ProcGlobal -> statusFlags [proc -> pgxactoff ] = 0 ;
566566
567567 for (index = 0 ; index < arrayP -> numProcs ; index ++ )
568568 {
@@ -575,8 +575,8 @@ ProcArrayRemove(PGPROC *proc, TransactionId latestXid)
575575 (arrayP -> numProcs - index - 1 ) * sizeof (* ProcGlobal -> xids ));
576576 memmove (& ProcGlobal -> subxidStates [index ], & ProcGlobal -> subxidStates [index + 1 ],
577577 (arrayP -> numProcs - index - 1 ) * sizeof (* ProcGlobal -> subxidStates ));
578- memmove (& ProcGlobal -> vacuumFlags [index ], & ProcGlobal -> vacuumFlags [index + 1 ],
579- (arrayP -> numProcs - index - 1 ) * sizeof (* ProcGlobal -> vacuumFlags ));
578+ memmove (& ProcGlobal -> statusFlags [index ], & ProcGlobal -> statusFlags [index + 1 ],
579+ (arrayP -> numProcs - index - 1 ) * sizeof (* ProcGlobal -> statusFlags ));
580580
581581 arrayP -> pgprocnos [arrayP -> numProcs - 1 ] = -1 ; /* for debugging */
582582 arrayP -> numProcs -- ;
@@ -660,13 +660,13 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid)
660660
661661 /* must be cleared with xid/xmin: */
662662 /* avoid unnecessarily dirtying shared cachelines */
663- if (proc -> vacuumFlags & PROC_VACUUM_STATE_MASK )
663+ if (proc -> statusFlags & PROC_VACUUM_STATE_MASK )
664664 {
665665 Assert (!LWLockHeldByMe (ProcArrayLock ));
666666 LWLockAcquire (ProcArrayLock , LW_SHARED );
667- Assert (proc -> vacuumFlags == ProcGlobal -> vacuumFlags [proc -> pgxactoff ]);
668- proc -> vacuumFlags &= ~PROC_VACUUM_STATE_MASK ;
669- ProcGlobal -> vacuumFlags [proc -> pgxactoff ] = proc -> vacuumFlags ;
667+ Assert (proc -> statusFlags == ProcGlobal -> statusFlags [proc -> pgxactoff ]);
668+ proc -> statusFlags &= ~PROC_VACUUM_STATE_MASK ;
669+ ProcGlobal -> statusFlags [proc -> pgxactoff ] = proc -> statusFlags ;
670670 LWLockRelease (ProcArrayLock );
671671 }
672672 }
@@ -695,10 +695,10 @@ ProcArrayEndTransactionInternal(PGPROC *proc, TransactionId latestXid)
695695
696696 /* must be cleared with xid/xmin: */
697697 /* avoid unnecessarily dirtying shared cachelines */
698- if (proc -> vacuumFlags & PROC_VACUUM_STATE_MASK )
698+ if (proc -> statusFlags & PROC_VACUUM_STATE_MASK )
699699 {
700- proc -> vacuumFlags &= ~PROC_VACUUM_STATE_MASK ;
701- ProcGlobal -> vacuumFlags [proc -> pgxactoff ] = proc -> vacuumFlags ;
700+ proc -> statusFlags &= ~PROC_VACUUM_STATE_MASK ;
701+ ProcGlobal -> statusFlags [proc -> pgxactoff ] = proc -> statusFlags ;
702702 }
703703
704704 /* Clear the subtransaction-XID cache too while holding the lock */
@@ -875,7 +875,7 @@ ProcArrayClearTransaction(PGPROC *proc)
875875 proc -> xmin = InvalidTransactionId ;
876876 proc -> recoveryConflictPending = false;
877877
878- Assert (!(proc -> vacuumFlags & PROC_VACUUM_STATE_MASK ));
878+ Assert (!(proc -> statusFlags & PROC_VACUUM_STATE_MASK ));
879879 Assert (!proc -> delayChkpt );
880880
881881 /*
@@ -1710,7 +1710,7 @@ ComputeXidHorizons(ComputeXidHorizonsResult *h)
17101710 {
17111711 int pgprocno = arrayP -> pgprocnos [index ];
17121712 PGPROC * proc = & allProcs [pgprocno ];
1713- int8 vacuumFlags = ProcGlobal -> vacuumFlags [index ];
1713+ int8 statusFlags = ProcGlobal -> statusFlags [index ];
17141714 TransactionId xid ;
17151715 TransactionId xmin ;
17161716
@@ -1745,7 +1745,7 @@ ComputeXidHorizons(ComputeXidHorizonsResult *h)
17451745 * removed, as long as pg_subtrans is not truncated) or doing logical
17461746 * decoding (which manages xmin separately, check below).
17471747 */
1748- if (vacuumFlags & (PROC_IN_VACUUM | PROC_IN_LOGICAL_DECODING ))
1748+ if (statusFlags & (PROC_IN_VACUUM | PROC_IN_LOGICAL_DECODING ))
17491749 continue ;
17501750
17511751 /* shared tables need to take backends in all database into account */
@@ -2194,7 +2194,7 @@ GetSnapshotData(Snapshot snapshot)
21942194 TransactionId * xip = snapshot -> xip ;
21952195 int * pgprocnos = arrayP -> pgprocnos ;
21962196 XidCacheStatus * subxidStates = ProcGlobal -> subxidStates ;
2197- uint8 * allVacuumFlags = ProcGlobal -> vacuumFlags ;
2197+ uint8 * allStatusFlags = ProcGlobal -> statusFlags ;
21982198
21992199 /*
22002200 * First collect set of pgxactoff/xids that need to be included in the
@@ -2204,7 +2204,7 @@ GetSnapshotData(Snapshot snapshot)
22042204 {
22052205 /* Fetch xid just once - see GetNewTransactionId */
22062206 TransactionId xid = UINT32_ACCESS_ONCE (other_xids [pgxactoff ]);
2207- uint8 vacuumFlags ;
2207+ uint8 statusFlags ;
22082208
22092209 Assert (allProcs [arrayP -> pgprocnos [pgxactoff ]].pgxactoff == pgxactoff );
22102210
@@ -2243,8 +2243,8 @@ GetSnapshotData(Snapshot snapshot)
22432243 * Skip over backends doing logical decoding which manages xmin
22442244 * separately (check below) and ones running LAZY VACUUM.
22452245 */
2246- vacuumFlags = allVacuumFlags [pgxactoff ];
2247- if (vacuumFlags & (PROC_IN_LOGICAL_DECODING | PROC_IN_VACUUM ))
2246+ statusFlags = allStatusFlags [pgxactoff ];
2247+ if (statusFlags & (PROC_IN_LOGICAL_DECODING | PROC_IN_VACUUM ))
22482248 continue ;
22492249
22502250 if (NormalTransactionIdPrecedes (xid , xmin ))
@@ -2483,11 +2483,11 @@ ProcArrayInstallImportedXmin(TransactionId xmin,
24832483 {
24842484 int pgprocno = arrayP -> pgprocnos [index ];
24852485 PGPROC * proc = & allProcs [pgprocno ];
2486- int vacuumFlags = ProcGlobal -> vacuumFlags [index ];
2486+ int statusFlags = ProcGlobal -> statusFlags [index ];
24872487 TransactionId xid ;
24882488
24892489 /* Ignore procs running LAZY VACUUM */
2490- if (vacuumFlags & PROC_IN_VACUUM )
2490+ if (statusFlags & PROC_IN_VACUUM )
24912491 continue ;
24922492
24932493 /* We are only interested in the specific virtual transaction. */
@@ -3142,7 +3142,7 @@ IsBackendPid(int pid)
31423142 * If excludeXmin0 is true, skip processes with xmin = 0.
31433143 * If allDbs is false, skip processes attached to other databases.
31443144 * If excludeVacuum isn't zero, skip processes for which
3145- * (vacuumFlags & excludeVacuum) is not zero.
3145+ * (statusFlags & excludeVacuum) is not zero.
31463146 *
31473147 * Note: the purpose of the limitXmin and excludeXmin0 parameters is to
31483148 * allow skipping backends whose oldest live snapshot is no older than
@@ -3176,12 +3176,12 @@ GetCurrentVirtualXIDs(TransactionId limitXmin, bool excludeXmin0,
31763176 {
31773177 int pgprocno = arrayP -> pgprocnos [index ];
31783178 PGPROC * proc = & allProcs [pgprocno ];
3179- uint8 vacuumFlags = ProcGlobal -> vacuumFlags [index ];
3179+ uint8 statusFlags = ProcGlobal -> statusFlags [index ];
31803180
31813181 if (proc == MyProc )
31823182 continue ;
31833183
3184- if (excludeVacuum & vacuumFlags )
3184+ if (excludeVacuum & statusFlags )
31853185 continue ;
31863186
31873187 if (allDbs || proc -> databaseId == MyDatabaseId )
@@ -3596,7 +3596,7 @@ CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared)
35963596 {
35973597 int pgprocno = arrayP -> pgprocnos [index ];
35983598 PGPROC * proc = & allProcs [pgprocno ];
3599- uint8 vacuumFlags = ProcGlobal -> vacuumFlags [index ];
3599+ uint8 statusFlags = ProcGlobal -> statusFlags [index ];
36003600
36013601 if (proc -> databaseId != databaseId )
36023602 continue ;
@@ -3610,7 +3610,7 @@ CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared)
36103610 else
36113611 {
36123612 (* nbackends )++ ;
3613- if ((vacuumFlags & PROC_IS_AUTOVACUUM ) &&
3613+ if ((statusFlags & PROC_IS_AUTOVACUUM ) &&
36143614 nautovacs < MAXAUTOVACPIDS )
36153615 autovac_pids [nautovacs ++ ] = proc -> pid ;
36163616 }
0 commit comments