@@ -488,13 +488,13 @@ ProcArrayAdd(PGPROC *proc)
488
488
(arrayP -> numProcs - index ) * sizeof (* ProcGlobal -> xids ));
489
489
memmove (& ProcGlobal -> subxidStates [index + 1 ], & ProcGlobal -> subxidStates [index ],
490
490
(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 ));
493
493
494
494
arrayP -> pgprocnos [index ] = proc -> pgprocno ;
495
495
ProcGlobal -> xids [index ] = proc -> xid ;
496
496
ProcGlobal -> subxidStates [index ] = proc -> subxidStatus ;
497
- ProcGlobal -> vacuumFlags [index ] = proc -> vacuumFlags ;
497
+ ProcGlobal -> statusFlags [index ] = proc -> statusFlags ;
498
498
499
499
arrayP -> numProcs ++ ;
500
500
@@ -562,7 +562,7 @@ ProcArrayRemove(PGPROC *proc, TransactionId latestXid)
562
562
Assert (TransactionIdIsValid (ProcGlobal -> xids [proc -> pgxactoff ] == 0 ));
563
563
Assert (TransactionIdIsValid (ProcGlobal -> subxidStates [proc -> pgxactoff ].count == 0 ));
564
564
Assert (TransactionIdIsValid (ProcGlobal -> subxidStates [proc -> pgxactoff ].overflowed == false));
565
- ProcGlobal -> vacuumFlags [proc -> pgxactoff ] = 0 ;
565
+ ProcGlobal -> statusFlags [proc -> pgxactoff ] = 0 ;
566
566
567
567
for (index = 0 ; index < arrayP -> numProcs ; index ++ )
568
568
{
@@ -575,8 +575,8 @@ ProcArrayRemove(PGPROC *proc, TransactionId latestXid)
575
575
(arrayP -> numProcs - index - 1 ) * sizeof (* ProcGlobal -> xids ));
576
576
memmove (& ProcGlobal -> subxidStates [index ], & ProcGlobal -> subxidStates [index + 1 ],
577
577
(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 ));
580
580
581
581
arrayP -> pgprocnos [arrayP -> numProcs - 1 ] = -1 ; /* for debugging */
582
582
arrayP -> numProcs -- ;
@@ -660,13 +660,13 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid)
660
660
661
661
/* must be cleared with xid/xmin: */
662
662
/* avoid unnecessarily dirtying shared cachelines */
663
- if (proc -> vacuumFlags & PROC_VACUUM_STATE_MASK )
663
+ if (proc -> statusFlags & PROC_VACUUM_STATE_MASK )
664
664
{
665
665
Assert (!LWLockHeldByMe (ProcArrayLock ));
666
666
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 ;
670
670
LWLockRelease (ProcArrayLock );
671
671
}
672
672
}
@@ -695,10 +695,10 @@ ProcArrayEndTransactionInternal(PGPROC *proc, TransactionId latestXid)
695
695
696
696
/* must be cleared with xid/xmin: */
697
697
/* avoid unnecessarily dirtying shared cachelines */
698
- if (proc -> vacuumFlags & PROC_VACUUM_STATE_MASK )
698
+ if (proc -> statusFlags & PROC_VACUUM_STATE_MASK )
699
699
{
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 ;
702
702
}
703
703
704
704
/* Clear the subtransaction-XID cache too while holding the lock */
@@ -875,7 +875,7 @@ ProcArrayClearTransaction(PGPROC *proc)
875
875
proc -> xmin = InvalidTransactionId ;
876
876
proc -> recoveryConflictPending = false;
877
877
878
- Assert (!(proc -> vacuumFlags & PROC_VACUUM_STATE_MASK ));
878
+ Assert (!(proc -> statusFlags & PROC_VACUUM_STATE_MASK ));
879
879
Assert (!proc -> delayChkpt );
880
880
881
881
/*
@@ -1710,7 +1710,7 @@ ComputeXidHorizons(ComputeXidHorizonsResult *h)
1710
1710
{
1711
1711
int pgprocno = arrayP -> pgprocnos [index ];
1712
1712
PGPROC * proc = & allProcs [pgprocno ];
1713
- int8 vacuumFlags = ProcGlobal -> vacuumFlags [index ];
1713
+ int8 statusFlags = ProcGlobal -> statusFlags [index ];
1714
1714
TransactionId xid ;
1715
1715
TransactionId xmin ;
1716
1716
@@ -1745,7 +1745,7 @@ ComputeXidHorizons(ComputeXidHorizonsResult *h)
1745
1745
* removed, as long as pg_subtrans is not truncated) or doing logical
1746
1746
* decoding (which manages xmin separately, check below).
1747
1747
*/
1748
- if (vacuumFlags & (PROC_IN_VACUUM | PROC_IN_LOGICAL_DECODING ))
1748
+ if (statusFlags & (PROC_IN_VACUUM | PROC_IN_LOGICAL_DECODING ))
1749
1749
continue ;
1750
1750
1751
1751
/* shared tables need to take backends in all database into account */
@@ -2194,7 +2194,7 @@ GetSnapshotData(Snapshot snapshot)
2194
2194
TransactionId * xip = snapshot -> xip ;
2195
2195
int * pgprocnos = arrayP -> pgprocnos ;
2196
2196
XidCacheStatus * subxidStates = ProcGlobal -> subxidStates ;
2197
- uint8 * allVacuumFlags = ProcGlobal -> vacuumFlags ;
2197
+ uint8 * allStatusFlags = ProcGlobal -> statusFlags ;
2198
2198
2199
2199
/*
2200
2200
* First collect set of pgxactoff/xids that need to be included in the
@@ -2204,7 +2204,7 @@ GetSnapshotData(Snapshot snapshot)
2204
2204
{
2205
2205
/* Fetch xid just once - see GetNewTransactionId */
2206
2206
TransactionId xid = UINT32_ACCESS_ONCE (other_xids [pgxactoff ]);
2207
- uint8 vacuumFlags ;
2207
+ uint8 statusFlags ;
2208
2208
2209
2209
Assert (allProcs [arrayP -> pgprocnos [pgxactoff ]].pgxactoff == pgxactoff );
2210
2210
@@ -2243,8 +2243,8 @@ GetSnapshotData(Snapshot snapshot)
2243
2243
* Skip over backends doing logical decoding which manages xmin
2244
2244
* separately (check below) and ones running LAZY VACUUM.
2245
2245
*/
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 ))
2248
2248
continue ;
2249
2249
2250
2250
if (NormalTransactionIdPrecedes (xid , xmin ))
@@ -2483,11 +2483,11 @@ ProcArrayInstallImportedXmin(TransactionId xmin,
2483
2483
{
2484
2484
int pgprocno = arrayP -> pgprocnos [index ];
2485
2485
PGPROC * proc = & allProcs [pgprocno ];
2486
- int vacuumFlags = ProcGlobal -> vacuumFlags [index ];
2486
+ int statusFlags = ProcGlobal -> statusFlags [index ];
2487
2487
TransactionId xid ;
2488
2488
2489
2489
/* Ignore procs running LAZY VACUUM */
2490
- if (vacuumFlags & PROC_IN_VACUUM )
2490
+ if (statusFlags & PROC_IN_VACUUM )
2491
2491
continue ;
2492
2492
2493
2493
/* We are only interested in the specific virtual transaction. */
@@ -3142,7 +3142,7 @@ IsBackendPid(int pid)
3142
3142
* If excludeXmin0 is true, skip processes with xmin = 0.
3143
3143
* If allDbs is false, skip processes attached to other databases.
3144
3144
* If excludeVacuum isn't zero, skip processes for which
3145
- * (vacuumFlags & excludeVacuum) is not zero.
3145
+ * (statusFlags & excludeVacuum) is not zero.
3146
3146
*
3147
3147
* Note: the purpose of the limitXmin and excludeXmin0 parameters is to
3148
3148
* allow skipping backends whose oldest live snapshot is no older than
@@ -3176,12 +3176,12 @@ GetCurrentVirtualXIDs(TransactionId limitXmin, bool excludeXmin0,
3176
3176
{
3177
3177
int pgprocno = arrayP -> pgprocnos [index ];
3178
3178
PGPROC * proc = & allProcs [pgprocno ];
3179
- uint8 vacuumFlags = ProcGlobal -> vacuumFlags [index ];
3179
+ uint8 statusFlags = ProcGlobal -> statusFlags [index ];
3180
3180
3181
3181
if (proc == MyProc )
3182
3182
continue ;
3183
3183
3184
- if (excludeVacuum & vacuumFlags )
3184
+ if (excludeVacuum & statusFlags )
3185
3185
continue ;
3186
3186
3187
3187
if (allDbs || proc -> databaseId == MyDatabaseId )
@@ -3596,7 +3596,7 @@ CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared)
3596
3596
{
3597
3597
int pgprocno = arrayP -> pgprocnos [index ];
3598
3598
PGPROC * proc = & allProcs [pgprocno ];
3599
- uint8 vacuumFlags = ProcGlobal -> vacuumFlags [index ];
3599
+ uint8 statusFlags = ProcGlobal -> statusFlags [index ];
3600
3600
3601
3601
if (proc -> databaseId != databaseId )
3602
3602
continue ;
@@ -3610,7 +3610,7 @@ CountOtherDBBackends(Oid databaseId, int *nbackends, int *nprepared)
3610
3610
else
3611
3611
{
3612
3612
(* nbackends )++ ;
3613
- if ((vacuumFlags & PROC_IS_AUTOVACUUM ) &&
3613
+ if ((statusFlags & PROC_IS_AUTOVACUUM ) &&
3614
3614
nautovacs < MAXAUTOVACPIDS )
3615
3615
autovac_pids [nautovacs ++ ] = proc -> pid ;
3616
3616
}
0 commit comments