Skip to content

Commit 32ac7a1

Browse files
Exclude VACUUMs from RunningXactData
GetRunningTransactionData() should ignore VACUUM procs because in some cases they are assigned xids. This could lead to holding back xmin via the route of passing the xid to standby and then having that hold back xmin on master via feedback. Backpatch to 9.1 needed, but will only do so on supported versions. Backpatch once proven on the buildfarm. Reported-by: Greg Stark Author: Simon Riggs Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/CANP8+jJBYt=4PpTfiPb0UrH1_iPhzsxKH5Op_Wec634F0ohnAw@mail.gmail.com
1 parent 848b1f3 commit 32ac7a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/storage/ipc/procarray.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,7 @@ ProcArrayInstallRestoredXmin(TransactionId xmin, PGPROC *proc)
19071907
* GetRunningTransactionData -- returns information about running transactions.
19081908
*
19091909
* Similar to GetSnapshotData but returns more information. We include
1910-
* all PGXACTs with an assigned TransactionId, even VACUUM processes.
1910+
* all PGXACTs with an assigned TransactionId, but not VACUUM processes.
19111911
*
19121912
* We acquire XidGenLock and ProcArrayLock, but the caller is responsible for
19131913
* releasing them. Acquiring XidGenLock ensures that no new XIDs enter the proc
@@ -1995,6 +1995,10 @@ GetRunningTransactionData(void)
19951995
volatile PGXACT *pgxact = &allPgXact[pgprocno];
19961996
TransactionId xid;
19971997

1998+
/* Ignore procs running LAZY VACUUM */
1999+
if (pgxact->vacuumFlags & PROC_IN_VACUUM)
2000+
continue;
2001+
19982002
/* Fetch xid just once - see GetNewTransactionId */
19992003
xid = pgxact->xid;
20002004

0 commit comments

Comments
 (0)