Unused parameter in ProcessSlotSyncInterrupts()

Started by cca55075 months ago3 messages
#1cca5507
cca5507@qq.com
1 attachment(s)

Hi,

When reading the code about slot sync, I find the $subject, attach a patch to fix it.

--
Regards,
ChangAo Chen

Attachments:

v1-0001-Remove-unused-parameter-in-ProcessSlotSyncInterru.patchapplication/octet-stream; charset=ISO-8859-1; name=v1-0001-Remove-unused-parameter-in-ProcessSlotSyncInterru.patchDownload
From 528d12fcf2dff352dae1ed206f59d9e04aed074d Mon Sep 17 00:00:00 2001
From: ChangAo Chen <cca5507@qq.com>
Date: Fri, 29 Aug 2025 22:31:27 +0800
Subject: [PATCH v1] Remove unused parameter in ProcessSlotSyncInterrupts().

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

diff --git a/src/backend/replication/logical/slotsync.c b/src/backend/replication/logical/slotsync.c
index caa003cb7b3..f5501c106dc 100644
--- a/src/backend/replication/logical/slotsync.c
+++ b/src/backend/replication/logical/slotsync.c
@@ -1170,7 +1170,7 @@ slotsync_reread_config(void)
  * Interrupt handler for main loop of slot sync worker.
  */
 static void
-ProcessSlotSyncInterrupts(WalReceiverConn *wrconn)
+ProcessSlotSyncInterrupts(void)
 {
 	CHECK_FOR_INTERRUPTS();
 
@@ -1505,7 +1505,7 @@ ReplSlotSyncWorkerMain(const void *startup_data, size_t startup_data_len)
 	{
 		bool		some_slot_updated = false;
 
-		ProcessSlotSyncInterrupts(wrconn);
+		ProcessSlotSyncInterrupts();
 
 		some_slot_updated = synchronize_slots(wrconn);
 
-- 
2.34.1

#2Nathan Bossart
nathandbossart@gmail.com
In reply to: cca5507 (#1)
Re: Unused parameter in ProcessSlotSyncInterrupts()

On Fri, Aug 29, 2025 at 10:40:25PM +0800, cca5507 wrote:

When reading the code about slot sync, I find the $subject, attach a
patch to fix it.

LGTM. I looked through the original thread [0]/messages/by-id/514f6f2f-6833-4539-39f1-96cd1e011f23@enterprisedb.com for clues about the origins
of this parameter, but it's a very long thread, and ctrl+f didn't help. It
seems to have become unused somewhere between v82 and v88 of the patch set,
though. In v82, ProcessSlotSyncInterrupts() has the following code:

+	if (ShutdownRequestPending)
+	{
+		if (wrconn)
+			walrcv_disconnect(wrconn);
+		ereport(LOG,
+				errmsg("replication slot sync worker is shutting down on receiving SIGINT"));
+		proc_exit(0);
+	}

[0]: /messages/by-id/514f6f2f-6833-4539-39f1-96cd1e011f23@enterprisedb.com

--
nathan

#3Nathan Bossart
nathandbossart@gmail.com
In reply to: Nathan Bossart (#2)
Re: Unused parameter in ProcessSlotSyncInterrupts()

Committed.

--
nathan