From 6a04a2ab692c7e91ad39964fce2652f71356f028 Mon Sep 17 00:00:00 2001
From: root <root@pgvm.rlsumirojk0etd4qpjbaa2afce.tx.internal.cloudapp.net>
Date: Thu, 20 Oct 2022 16:28:58 +0000
Subject: [PATCH] Fix GetWALAvailability function code comments

When checkpoint remove the WAL required for the replication stream, it invalidates the slot and walsender is terminated.
---
 src/backend/access/transam/xlog.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 81d339d57d..4ac46de508 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7363,7 +7363,8 @@ CreateRestartPoint(int flags)
  *   above.
  *
  * * WALAVAIL_REMOVED means it has been removed. A replication stream on
- *   a slot with this LSN cannot continue after a restart.
+ *   a slot with this LSN cannot continue. Note that the affected processes
+ *   have been terminated by checkpointer, too.
  *
  * * WALAVAIL_INVALID_LSN means the slot hasn't been set to reserve WAL.
  */
-- 
2.25.1

