From 9aa91cb33b70c5bc207e1a136d60f742acd67c32 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 11 Nov 2021 11:03:29 -0300 Subject: [PATCH] Restore lock level to set vacuum flags Commit 27838981be9d mistakenly reduced the lock level from exclusive to shared that is acquired to set PGPROC->statusFlags; this was reverted by dcfff74fb166, but failed to do so in one spot. Fix it. Backpatch to 14. Noted by Andres Freund. Discussion: https://postgr.es/m/20211111020724.ggsfhcq3krq5r4hb@alap3.anarazel.de --- src/backend/replication/slot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index d2a145e1223..3f348321518 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -511,7 +511,7 @@ ReplicationSlotRelease(void) MyReplicationSlot = NULL; /* might not have been set when we've been a plain slot */ - LWLockAcquire(ProcArrayLock, LW_SHARED); + LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE); MyProc->statusFlags &= ~PROC_IN_LOGICAL_DECODING; ProcGlobal->statusFlags[MyProc->pgxactoff] = MyProc->statusFlags; LWLockRelease(ProcArrayLock);