diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index 1c6c0c7ce2..e4f5c6fb36 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -512,7 +512,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);