diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index e5d487dbb7..4adb286d5b 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -491,7 +491,6 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid) volatile PROC_HDR *procglobal = ProcGlobal; uint32 nextidx; uint32 wakeidx; - int extraWaits = -1; /* We should definitely have an XID to clear. */ Assert(TransactionIdIsValid(allPgXact[proc->pgprocno].xid)); @@ -518,6 +517,8 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId latestXid) */ if (nextidx != INVALID_PGPROCNO) { + int extraWaits = 0; + /* Sleep until the leader clears our XID. */ for (;;) {