diff --git a/src/backend/distributed/transaction/lock_graph.c b/src/backend/distributed/transaction/lock_graph.c index 9265bd320..30dec5d80 100644 --- a/src/backend/distributed/transaction/lock_graph.c +++ b/src/backend/distributed/transaction/lock_graph.c @@ -461,9 +461,7 @@ IsProcessWaitingForSafeOperations(PGPROC *proc) return false; } - /* get the transaction that the backend associated with */ - PGXACT *pgxact = &ProcGlobal->allPgXact[proc->pgprocno]; - if (pgxact->vacuumFlags & PROC_IS_AUTOVACUUM) + if (pgproc_statusflags_compat(proc) & PROC_IS_AUTOVACUUM) { return true; } diff --git a/src/include/distributed/version_compat.h b/src/include/distributed/version_compat.h index 29fa67c5f..1155488c4 100644 --- a/src/include/distributed/version_compat.h +++ b/src/include/distributed/version_compat.h @@ -57,6 +57,7 @@ #define COPY_FRONTEND_COMPAT COPY_FRONTEND #define SetTuplestoreDestReceiverParams_compat(a, b, c, d, e, f) \ SetTuplestoreDestReceiverParams(a, b, c, d, e, f) +#define pgproc_statusflags_compat(pgproc) ((pgproc)->statusFlags) #else #define AlterTableStmtObjType(a) ((a)->relkind) #define F_NEXTVAL_COMPAT F_NEXTVAL_OID @@ -86,6 +87,8 @@ #define COPY_FRONTEND_COMPAT COPY_NEW_FE #define SetTuplestoreDestReceiverParams_compat(a, b, c, d, e, f) \ SetTuplestoreDestReceiverParams(a, b, c, d) +#define pgproc_statusflags_compat(pgproc) \ + ((&ProcGlobal->allPgXact[(pgproc)->pgprocno])->vacuumFlags) #endif #if PG_VERSION_NUM >= PG_VERSION_13