@@ -587,9 +587,9 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid)
587
587
Assert (!TransactionIdIsValid (allPgXact [proc -> pgprocno ].xid ));
588
588
589
589
proc -> lxid = InvalidLocalTransactionId ;
590
- pgxact -> xmin = InvalidTransactionId ;
591
590
/* must be cleared with xid/xmin: */
592
591
pgxact -> vacuumFlags &= ~PROC_VACUUM_STATE_MASK ;
592
+ proc -> xmin = InvalidTransactionId ;
593
593
proc -> delayChkpt = false; /* be sure this is cleared in abort */
594
594
proc -> recoveryConflictPending = false;
595
595
@@ -609,9 +609,9 @@ ProcArrayEndTransactionInternal(PGPROC *proc, PGXACT *pgxact,
609
609
{
610
610
pgxact -> xid = InvalidTransactionId ;
611
611
proc -> lxid = InvalidLocalTransactionId ;
612
- pgxact -> xmin = InvalidTransactionId ;
613
612
/* must be cleared with xid/xmin: */
614
613
pgxact -> vacuumFlags &= ~PROC_VACUUM_STATE_MASK ;
614
+ proc -> xmin = InvalidTransactionId ;
615
615
proc -> delayChkpt = false; /* be sure this is cleared in abort */
616
616
proc -> recoveryConflictPending = false;
617
617
@@ -763,7 +763,7 @@ ProcArrayClearTransaction(PGPROC *proc)
763
763
*/
764
764
pgxact -> xid = InvalidTransactionId ;
765
765
proc -> lxid = InvalidLocalTransactionId ;
766
- pgxact -> xmin = InvalidTransactionId ;
766
+ proc -> xmin = InvalidTransactionId ;
767
767
proc -> recoveryConflictPending = false;
768
768
769
769
/* redundant, but just in case */
@@ -1563,7 +1563,7 @@ ComputeXidHorizons(ComputeXidHorizonsResult *h)
1563
1563
1564
1564
/* Fetch xid just once - see GetNewTransactionId */
1565
1565
xid = UINT32_ACCESS_ONCE (pgxact -> xid );
1566
- xmin = UINT32_ACCESS_ONCE (pgxact -> xmin );
1566
+ xmin = UINT32_ACCESS_ONCE (proc -> xmin );
1567
1567
1568
1568
/*
1569
1569
* Consider both the transaction's Xmin, and its Xid.
@@ -1838,7 +1838,7 @@ GetMaxSnapshotSubxidCount(void)
1838
1838
*
1839
1839
* We also update the following backend-global variables:
1840
1840
* 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).
1842
1842
* RecentXmin: the xmin computed for the most recent snapshot. XIDs
1843
1843
* older than this are known not running any more.
1844
1844
*
@@ -1899,7 +1899,7 @@ GetSnapshotData(Snapshot snapshot)
1899
1899
1900
1900
/*
1901
1901
* 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.
1903
1903
*/
1904
1904
LWLockAcquire (ProcArrayLock , LW_SHARED );
1905
1905
@@ -2051,8 +2051,8 @@ GetSnapshotData(Snapshot snapshot)
2051
2051
replication_slot_xmin = procArray -> replication_slot_xmin ;
2052
2052
replication_slot_catalog_xmin = procArray -> replication_slot_catalog_xmin ;
2053
2053
2054
- if (!TransactionIdIsValid (MyPgXact -> xmin ))
2055
- MyPgXact -> xmin = TransactionXmin = xmin ;
2054
+ if (!TransactionIdIsValid (MyProc -> xmin ))
2055
+ MyProc -> xmin = TransactionXmin = xmin ;
2056
2056
2057
2057
LWLockRelease (ProcArrayLock );
2058
2058
@@ -2172,7 +2172,7 @@ GetSnapshotData(Snapshot snapshot)
2172
2172
}
2173
2173
2174
2174
/*
2175
- * ProcArrayInstallImportedXmin -- install imported xmin into MyPgXact ->xmin
2175
+ * ProcArrayInstallImportedXmin -- install imported xmin into MyProc ->xmin
2176
2176
*
2177
2177
* This is called when installing a snapshot imported from another
2178
2178
* transaction. To ensure that OldestXmin doesn't go backwards, we must
@@ -2225,7 +2225,7 @@ ProcArrayInstallImportedXmin(TransactionId xmin,
2225
2225
/*
2226
2226
* Likewise, let's just make real sure its xmin does cover us.
2227
2227
*/
2228
- xid = UINT32_ACCESS_ONCE (pgxact -> xmin );
2228
+ xid = UINT32_ACCESS_ONCE (proc -> xmin );
2229
2229
if (!TransactionIdIsNormal (xid ) ||
2230
2230
!TransactionIdPrecedesOrEquals (xid , xmin ))
2231
2231
continue ;
@@ -2236,7 +2236,7 @@ ProcArrayInstallImportedXmin(TransactionId xmin,
2236
2236
* GetSnapshotData first, we'll be overwriting a valid xmin here, so
2237
2237
* we don't check that.)
2238
2238
*/
2239
- MyPgXact -> xmin = TransactionXmin = xmin ;
2239
+ MyProc -> xmin = TransactionXmin = xmin ;
2240
2240
2241
2241
result = true;
2242
2242
break ;
@@ -2248,7 +2248,7 @@ ProcArrayInstallImportedXmin(TransactionId xmin,
2248
2248
}
2249
2249
2250
2250
/*
2251
- * ProcArrayInstallRestoredXmin -- install restored xmin into MyPgXact ->xmin
2251
+ * ProcArrayInstallRestoredXmin -- install restored xmin into MyProc ->xmin
2252
2252
*
2253
2253
* This is like ProcArrayInstallImportedXmin, but we have a pointer to the
2254
2254
* PGPROC of the transaction from which we imported the snapshot, rather than
@@ -2261,28 +2261,25 @@ ProcArrayInstallRestoredXmin(TransactionId xmin, PGPROC *proc)
2261
2261
{
2262
2262
bool result = false;
2263
2263
TransactionId xid ;
2264
- PGXACT * pgxact ;
2265
2264
2266
2265
Assert (TransactionIdIsNormal (xmin ));
2267
2266
Assert (proc != NULL );
2268
2267
2269
2268
/* Get lock so source xact can't end while we're doing this */
2270
2269
LWLockAcquire (ProcArrayLock , LW_SHARED );
2271
2270
2272
- pgxact = & allPgXact [proc -> pgprocno ];
2273
-
2274
2271
/*
2275
2272
* Be certain that the referenced PGPROC has an advertised xmin which is
2276
2273
* no later than the one we're installing, so that the system-wide xmin
2277
2274
* can't go backwards. Also, make sure it's running in the same database,
2278
2275
* so that the per-database xmin cannot go backwards.
2279
2276
*/
2280
- xid = UINT32_ACCESS_ONCE (pgxact -> xmin );
2277
+ xid = UINT32_ACCESS_ONCE (proc -> xmin );
2281
2278
if (proc -> databaseId == MyDatabaseId &&
2282
2279
TransactionIdIsNormal (xid ) &&
2283
2280
TransactionIdPrecedesOrEquals (xid , xmin ))
2284
2281
{
2285
- MyPgXact -> xmin = TransactionXmin = xmin ;
2282
+ MyProc -> xmin = TransactionXmin = xmin ;
2286
2283
result = true;
2287
2284
}
2288
2285
@@ -2908,7 +2905,7 @@ GetCurrentVirtualXIDs(TransactionId limitXmin, bool excludeXmin0,
2908
2905
if (allDbs || proc -> databaseId == MyDatabaseId )
2909
2906
{
2910
2907
/* Fetch xmin just once - might change on us */
2911
- TransactionId pxmin = UINT32_ACCESS_ONCE (pgxact -> xmin );
2908
+ TransactionId pxmin = UINT32_ACCESS_ONCE (proc -> xmin );
2912
2909
2913
2910
if (excludeXmin0 && !TransactionIdIsValid (pxmin ))
2914
2911
continue ;
@@ -2994,7 +2991,6 @@ GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid)
2994
2991
{
2995
2992
int pgprocno = arrayP -> pgprocnos [index ];
2996
2993
PGPROC * proc = & allProcs [pgprocno ];
2997
- PGXACT * pgxact = & allPgXact [pgprocno ];
2998
2994
2999
2995
/* Exclude prepared transactions */
3000
2996
if (proc -> pid == 0 )
@@ -3004,7 +3000,7 @@ GetConflictingVirtualXIDs(TransactionId limitXmin, Oid dbOid)
3004
3000
proc -> databaseId == dbOid )
3005
3001
{
3006
3002
/* 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 );
3008
3004
3009
3005
/*
3010
3006
* We ignore an invalid pxmin because this means that backend has
0 commit comments