v3-0002-Add-a-DEBUG1-message-for-slot-sync.patch

application/octet-stream

Filename: v3-0002-Add-a-DEBUG1-message-for-slot-sync.patch
Type: application/octet-stream
Part: 0
Message: RE: Synchronizing slots from primary to standby

Patch

Format: format-patch
Series: patch v3-0002
Subject: Add a DEBUG1 message for slot sync
File+
src/backend/replication/logical/slotsync.c 3 0
From 4beb7424b8b1bb6e3ee43f86d3d40f7143f8316e Mon Sep 17 00:00:00 2001
From: Hou Zhijie <sherlockcpp@foxmail.com>
Date: Thu, 15 Feb 2024 22:25:23 +0800
Subject: [PATCH v3 2/3] Add a DEBUG1 message for slot sync

---
 src/backend/replication/logical/slotsync.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/backend/replication/logical/slotsync.c b/src/backend/replication/logical/slotsync.c
index 03536fe273..f1542ef0e9 100644
--- a/src/backend/replication/logical/slotsync.c
+++ b/src/backend/replication/logical/slotsync.c
@@ -321,6 +321,9 @@ reserve_wal_for_local_slot(XLogRecPtr restart_lsn)
 			oldest_segno = XLogGetOldestSegno(cur_timeline);
 		}
 
+		elog(DEBUG1, "segno: %ld of purposed restart_lsn for the synced slot, oldest_segno: %ld available",
+			 segno, oldest_segno);
+
 		/*
 		 * If all required WAL is still there, great, otherwise retry. The
 		 * slot should prevent further removal of WAL, unless there's a
-- 
2.34.1