From daf3b889f0b7b688db5d59ce586e2eb3c1e081c8 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Tue, 23 Jun 2026 23:30:09 +0300
Subject: [PATCH 5/6] Fix comment on WaitForAllTransactionsToFinish() on
 postmaster death

The comment claimed that it sets "the abort flag" on postmaster death,
but it actually just errors outs. In the passing, improve the comment
to explain why it doesn't just use WL_EXIT_ON_PM_DEATH.
---
 src/backend/postmaster/datachecksum_state.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/backend/postmaster/datachecksum_state.c b/src/backend/postmaster/datachecksum_state.c
index c7aff4a38da..1ad8fea93f0 100644
--- a/src/backend/postmaster/datachecksum_state.c
+++ b/src/backend/postmaster/datachecksum_state.c
@@ -1000,9 +1000,7 @@ launcher_cancel_handler(SIGNAL_ARGS)
  *		Blocks awaiting all current transactions to finish
  *
  * Returns when all transactions which are active at the call of the function
- * have ended, or if the postmaster dies while waiting. If the postmaster dies
- * the abort flag will be set to indicate that the caller of this shouldn't
- * proceed.
+ * have ended.
  *
  * NB: this will return early, if aborted by SIGINT or if the target state
  * is changed while we're running.
@@ -1036,8 +1034,8 @@ WaitForAllTransactionsToFinish(void)
 					   WAIT_EVENT_CHECKSUM_ENABLE_STARTCONDITION);
 
 		/*
-		 * If the postmaster died we won't be able to enable checksums
-		 * cluster-wide so abort and hope to continue when restarted.
+		 * If the postmaster died, bail out.  But first print a log message to
+		 * note that the checksumming didn't complete.
 		 */
 		if (rc & WL_POSTMASTER_DEATH)
 			ereport(FATAL,
-- 
2.47.3

