From 0d4a1ce9b964f7fbf0f171b762571ee3778aa154 Mon Sep 17 00:00:00 2001
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Date: Sat, 13 Apr 2024 07:03:37 +0000
Subject: [PATCH v1] Add missing ConditionVariableCancelSleep in slot.c

---
 src/backend/replication/slot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index cebf44bb0f..4b86f0cb75 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -1721,6 +1721,8 @@ InvalidatePossiblyObsoleteSlot(ReplicationSlotInvalidationCause cause,
 			ConditionVariableSleep(&s->active_cv,
 								   WAIT_EVENT_REPLICATION_SLOT_DROP);
 
+			ConditionVariableCancelSleep();
+
 			/*
 			 * Re-acquire lock and start over; we expect to invalidate the
 			 * slot next time (unless another process acquires the slot in the
-- 
2.34.1

