@@ -587,9 +587,9 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid)
587587 Assert (!TransactionIdIsValid (allPgXact [proc -> pgprocno ].xid ));
588588
589589 proc -> lxid = InvalidLocalTransactionId ;
590- pgxact -> xmin = InvalidTransactionId ;
591590 /* must be cleared with xid/xmin: */
592591 pgxact -> vacuumFlags &= ~PROC_VACUUM_STATE_MASK ;
592+ proc -> xmin = InvalidTransactionId ;
593593 proc -> delayChkpt = false; /* be sure this is cleared in abort */
594594 proc -> recoveryConflictPending = false;
595595
@@ -609,9 +609,9 @@ ProcArrayEndTransactionInternal(PGPROC *proc, PGXACT *pgxact,
609609{
610610 pgxact -> xid = InvalidTransactionId ;
611611 proc -> lxid = InvalidLocalTransactionId ;
612- pgxact -> xmin = InvalidTransactionId ;
613612 /* must be cleared with xid/xmin: */
614613 pgxact -> vacuumFlags &= ~PROC_VACUUM_STATE_MASK ;
614+ proc -> xmin = InvalidTransactionId ;
615615 proc -> delayChkpt = false; /* be sure this is cleared in abort */
616616 proc -> recoveryConflictPending = false;
617617
@@ -763,7 +763,7 @@ ProcArrayClearTransaction(PGPROC *proc)
763763 */
764764 pgxact -> xid = InvalidTransactionId ;
765765 proc -> lxid = InvalidLocalTransactionId ;
766- pgxact -> xmin = InvalidTransactionId ;
766+ proc -> xmin = InvalidTransactionId ;
767767 proc -> recoveryConflictPending = false;
768768
769769 /* redundant, but just in case */
@@ -1563,7 +1563,7 @@ ComputeXidHorizons(ComputeXidHorizonsResult *h)
15631563
15641564 /* Fetch xid just once - see GetNewTransactionId */
15651565 xid = UINT32_ACCESS_ONCE (pgxact -> xid );
1566- xmin = UINT32_ACCESS_ONCE (pgxact -> xmin );
1566+ xmin = UINT32_ACCESS_ONCE (proc -> xmin );
15671567
15681568 /*
15691569 * Consider both the transaction's Xmin, and its Xid.
@@ -1838,7 +1838,7 @@ GetMaxSnapshotSubxidCount(void)
18381838 *
18391839 * We also update the following backend-global variables:
18401840 * TransactionXmin: the oldest xmin of any snapshot in use in the
1841- * current transaction (this is the same as MyPgXact ->xmin).
1841+ * current transaction (this is the same as MyProc ->xmin).
18421842 * RecentXmin: the xmin computed for the most recent snapshot. XIDs
18431843 * older than this are known not running any more.
18441844 *
@@ -1899,7 +1899,7 @@ GetSnapshotData(Snapshot snapshot)
18991899
19001900 /*
19011901 * It is sufficient to get shared lock on ProcArrayLock, even if we are
1902- * going to set MyPgXact ->xmin.
1902+ * going to set MyProc ->xmin.
19031903 */
19041904 LWLockAcquire (ProcArrayLock , LW_SHARED );
19051905
@@ -2051,8 +2051,8 @@ GetSnapshotData(Snapshot snapshot)
20512051 replication_slot_xmin = procArray -> replication_slot_xmin ;
20522052 replication_slot_catalog_xmin = procArray -> replication_slot_catalog_xmin ;
20532053
2054- if (!TransactionIdIsValid (MyPgXact -> xmin ))
2055- MyPgXact -> xmin = TransactionXmin = xmin ;
2054+ if (!TransactionIdIsValid (MyProc -> xmin ))
2055+ MyProc -> xmin = TransactionXmin = xmin ;
20562056
20572057 LWLockRelease (ProcArrayLock );
20582058
@@ -2172,7 +2172,7 @@ GetSnapshotData(Snapshot snapshot)
21722172}
21732173
21742174/*
2175- * ProcArrayInstallImportedXmin -- install imported xmin into MyPgXact ->xmin
2175+ * ProcArrayInstallImportedXmin -- install imported xmin into MyProc ->xmin
21762176 *
21772177 * This is called when installing a snapshot imported from another
21782178 * transaction. To ensure that OldestXmin doesn't go backwards, we must
@@ -2225,7 +2225,7 @@ ProcArrayInstallImportedXmin(TransactionId xmin,
22252225 /*
22262226 * Likewise, let's just make real sure its xmin does cover us.
22272227 */
2228- xid = UINT32_ACCESS_ONCE (pgxact -> xmin );
2228+ xid = UINT32_ACCESS_ONCE (proc -> xmin );
22292229 if (!TransactionIdIsNormal (xid ) ||
22302230 !TransactionIdPrecedesOrEquals (xid , xmin ))
22312231 continue ;
@@ -2236,7 +2236,7 @@ ProcArrayInstallImportedXmin(TransactionId xmin,
22362236 * GetSnapshotData first, we'll be overwriting a valid xmin here, so
22372237 * we don't check that.)
22382238 */
2239- MyPgXact -> xmin = TransactionXmin = xmin ;
2239+ MyProc -> xmin = TransactionXmin = xmin ;
22402240
22412241 result = true;
22422242 break ;
@@ -2248,7 +2248,7 @@ ProcArrayInstallImportedXmin(TransactionId xmin,
22482248}
22492249
22502250/*
2251- * ProcArrayInstallRestoredXmin -- install restored xmin into MyPgXact ->xmin
2251+ * ProcArrayInstallRestoredXmin -- install restored xmin into MyProc ->xmin
22522252 *
22532253 * This is like ProcArrayInstallImportedXmin, but we have a pointer to the
22542254 * PGPROC of the transaction from which we imported the snapshot, rather than
@@ -2261,28 +2261,25 @@ ProcArrayInstallRestoredXmin(TransactionId xmin, PGPROC *proc)
22612261{
22622262 bool result = false;
22632263 TransactionId xid ;
2264- PGXACT * pgxact ;
22652264
22662265 Assert (TransactionIdIsNormal (xmin ));
22672266 Assert (proc != NULL );
22682267
22692268 /* Get lock so source xact can't end while we're doing this */
22702269 LWLockAcquire (ProcArrayLock , LW_SHARED );
22712270
2272- pgxact = & allPgXact [proc -> pgprocno ];
2273-
22742271 /*
22752272 * Be certain that the referenced PGPROC has an advertised xmin which is
22762273 * no later than the one we're installing, so that the system-wide xmin
22772274 * can't go backwards. Also, make sure it's running in the same database,
22782275 * so that the per-database xmin cannot go backwards.
22792276 */
2280- xid = UINT32_ACCESS_ONCE (pgxact -> xmin );
2277+ xid = UINT32_ACCESS_ONCE (proc -> xmin );
22812278 if (proc -> databaseId == MyDatabaseId &&
22822279 TransactionIdIsNormal (xid ) &&
22832280 TransactionIdPrecedesOrEquals (xid , xmin ))
22842281 {
2285- MyPgXact -> xmin = TransactionXmin = xmin ;
2282+ MyProc -> xmin = TransactionXmin = xmin ;
22862283 result = true;
22872284 }
22882285
@@ -2908,7 +2905,7 @@ GetCurrentVirtualXIDs(TransactionId limitXmin, bool excludeXmin0,
29082905 if (allDbs || proc -> databaseId == MyDatabaseId )
29092906 {
29102907 /* Fetch xmin just once - might change on us */
2911- TransactionId pxmin = UINT32_ACCESS_ONCE (pgxact -> xmin );
2908+ TransactionId pxmin = UINT32_ACCESS_ONCE (proc -> xmin );
29122909
29132910 if (excludeXmin0 && !TransactionIdIsValid (pxmin ))
29142911 continue ;
@@ -2994,7 +2991,6 @@ GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid)
29942991 {
29952992 int pgprocno = arrayP -> pgprocnos [index ];
29962993 PGPROC * proc = & allProcs [pgprocno ];
2997- PGXACT * pgxact = & allPgXact [pgprocno ];
29982994
29992995 /* Exclude prepared transactions */
30002996 if (proc -> pid == 0 )
@@ -3004,7 +3000,7 @@ GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid)
30043000 proc -> databaseId == dbOid )
30053001 {
30063002 /* Fetch xmin just once - can't change on us, but good coding */
3007- TransactionId pxmin = UINT32_ACCESS_ONCE (pgxact -> xmin );
3003+ TransactionId pxmin = UINT32_ACCESS_ONCE (proc -> xmin );
30083004
30093005 /*
30103006 * We ignore an invalid pxmin because this means that backend has
0 commit comments