From 8deac37278ba4388de7259d921e6e4e6385072a1 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Wed, 28 Sep 2022 09:48:33 +1000
Subject: [PATCH v1] Tidied some GUC C variable declarations.

Added comments to indicate the GUC variables.

Removed some unnecessary C variable assignments since the default values
will be assigned/overwritten by the GUC mechanism.
---
 src/backend/replication/logical/launcher.c |  5 +++--
 src/backend/replication/slot.c             |  6 +++---
 src/backend/replication/walsender.c        | 10 +++++-----
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/backend/replication/logical/launcher.c b/src/backend/replication/logical/launcher.c
index 3bbd522..66007ca 100644
--- a/src/backend/replication/logical/launcher.c
+++ b/src/backend/replication/logical/launcher.c
@@ -52,8 +52,9 @@
 /* max sleep time between cycles (3min) */
 #define DEFAULT_NAPTIME_PER_CYCLE 180000L
 
-int			max_logical_replication_workers = 4;
-int			max_sync_workers_per_subscription = 2;
+/* GUC variables. */
+int			max_logical_replication_workers;
+int			max_sync_workers_per_subscription;
 
 LogicalRepWorker *MyLogicalRepWorker = NULL;
 
diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index 0bd0031..b265fa8 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -97,9 +97,9 @@ ReplicationSlotCtlData *ReplicationSlotCtl = NULL;
 /* My backend's replication slot in the shared memory array */
 ReplicationSlot *MyReplicationSlot = NULL;
 
-/* GUCs */
-int			max_replication_slots = 0;	/* the maximum number of replication
-										 * slots */
+/* GUC variable. */
+int			max_replication_slots;	/* the maximum number of replication
+									 * slots */
 
 static void ReplicationSlotShmemExit(int code, Datum arg);
 static void ReplicationSlotDropAcquired(void);
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index e9ba500..e9c1429 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -118,12 +118,12 @@ bool		am_cascading_walsender = false; /* Am I cascading WAL to another
 											 * standby? */
 bool		am_db_walsender = false;	/* Connected to a database? */
 
-/* User-settable parameters for walsender */
-int			max_wal_senders = 0;	/* the maximum number of concurrent
+/* GUC variables. */
+int			max_wal_senders;		/* the maximum number of concurrent
 									 * walsenders */
-int			wal_sender_timeout = 60 * 1000; /* maximum time to send one WAL
-											 * data message */
-bool		log_replication_commands = false;
+int			wal_sender_timeout; 	/* maximum time to send one WAL
+									 * data message */
+bool		log_replication_commands;
 
 /*
  * State for WalSndWakeupRequest
-- 
1.8.3.1

