From 3a5304d30e299dc836854a98597f4a09267894a1 Mon Sep 17 00:00:00 2001
From: Robert Haas <rhaas@postgresql.org>
Date: Wed, 17 Jul 2024 14:53:00 -0400
Subject: [PATCH v2 1/3] Add missing call to ConditionVariableCancelSleep().

After calling ConditionVariableSleep() or ConditionVariableTimedSleep()
one or more times, code is supposed to call ConditionVariableCancelSleep()
to remove itself from the waitlist. This code neglected to do so.
As far as I know, that had no observable consequences, but let's make
the code correct.
---
 src/backend/postmaster/walsummarizer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/backend/postmaster/walsummarizer.c b/src/backend/postmaster/walsummarizer.c
index 83c178e766..191b360bef 100644
--- a/src/backend/postmaster/walsummarizer.c
+++ b/src/backend/postmaster/walsummarizer.c
@@ -682,6 +682,8 @@ WaitForWalSummarization(XLogRecPtr lsn, long timeout, XLogRecPtr *pending_lsn)
 									WAIT_EVENT_WAL_SUMMARY_READY);
 	}
 
+	ConditionVariableCancelSleep();
+
 	return summarized_lsn;
 }
 
-- 
2.39.3 (Apple Git-145)

