From f8d3e50f255fe0acb6cc9fd13cc4630e6cb74631 Mon Sep 17 00:00:00 2001 From: Halil Ozan Akgul Date: Wed, 11 Aug 2021 15:47:41 +0300 Subject: [PATCH] Introduces STATUS_WAITING_COMPAT macro The STATUS_WAITING define is removed and an enum with PROC_WAIT_STATUS_WAITING is added instead This macro uses appropriate one Relevant PG commit: a513f1dfbf2c29a51b0f7cbd5913ce2d2ee452c5 --- src/backend/distributed/transaction/lock_graph.c | 4 ++-- src/include/distributed/version_compat.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/distributed/transaction/lock_graph.c b/src/backend/distributed/transaction/lock_graph.c index aed021ae0..9265bd320 100644 --- a/src/backend/distributed/transaction/lock_graph.c +++ b/src/backend/distributed/transaction/lock_graph.c @@ -456,7 +456,7 @@ BuildLocalWaitGraph(void) static bool IsProcessWaitingForSafeOperations(PGPROC *proc) { - if (proc->waitStatus != STATUS_WAITING) + if (proc->waitStatus != PROC_WAIT_STATUS_WAITING) { return false; } @@ -715,7 +715,7 @@ AddProcToVisit(PROCStack *remaining, PGPROC *proc) bool IsProcessWaitingForLock(PGPROC *proc) { - return proc->waitStatus == STATUS_WAITING; + return proc->waitStatus == PROC_WAIT_STATUS_WAITING; } diff --git a/src/include/distributed/version_compat.h b/src/include/distributed/version_compat.h index 5bea3c427..9581d3804 100644 --- a/src/include/distributed/version_compat.h +++ b/src/include/distributed/version_compat.h @@ -34,10 +34,12 @@ #define AlterTableStmtObjType(a) ((a)->objtype) #define F_NEXTVAL_COMPAT F_NEXTVAL #define ROLE_MONITOR_COMPAT ROLE_PG_MONITOR +#define STATUS_WAITING_COMPAT PROC_WAIT_STATUS_WAITING #else #define AlterTableStmtObjType(a) ((a)->relkind) #define F_NEXTVAL_COMPAT F_NEXTVAL_OID #define ROLE_MONITOR_COMPAT DEFAULT_ROLE_MONITOR +#define STATUS_WAITING_COMPAT STATUS_WAITING #endif #if PG_VERSION_NUM >= PG_VERSION_13