On Thu, Feb 15, 2024 at 12:07 PM Zhijie Hou (Fujitsu)
<[email protected]> wrote:
>
> Since the slotsync function is committed, I rebased remaining patches.
> And here is the V88 patch set.
>
Please find the improvements in some of the comments in v88_0001*
attached. Kindly include these in next version, if you are okay with
it.
--
With Regards,
Amit Kapila.
diff --git a/src/backend/access/transam/xlogrecovery.c
b/src/backend/access/transam/xlogrecovery.c
index 68f48c052c..6173143bcf 100644
--- a/src/backend/access/transam/xlogrecovery.c
+++ b/src/backend/access/transam/xlogrecovery.c
@@ -1469,16 +1469,16 @@ FinishWalRecovery(void)
XLogShutdownWalRcv();
/*
- * Shutdown the slot sync workers to prevent potential conflicts between
- * user processes and slotsync workers after a promotion.
+ * Shutdown the slot sync worker to prevent it from keep trying to fetch
+ * slots and drop any temporary slots.
*
* We do not update the 'synced' column from true to false here, as any
* failed update could leave 'synced' column false for some slots. This
* could cause issues during slot sync after restarting the server as a
- * standby. While updating after switching to the new timeline is an
- * option, it does not simplify the handling for 'synced' column.
- * Therefore, we retain the 'synced' column as true after promotion as
it
- * may provide useful information about the slot origin.
+ * standby. While updating the 'synced' column after switching to the
new
+ * timeline is an option, it does not simplify the handling for the
+ * 'synced' column. Therefore, we retain the 'synced' column as true
after
+ * promotion as it may provide useful information about the slot origin.
*/
ShutDownSlotSync();
diff --git a/src/backend/postmaster/postmaster.c
b/src/backend/postmaster/postmaster.c
index b0334ce449..011b5f4828 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -168,7 +168,7 @@
* they will never become live backends. dead_end children are not assigned a
* PMChildSlot. dead_end children have bkend_type NORMAL.
*
- * "Special" children such as the startup, bgwriter, autovacuum launcher and
+ * "Special" children such as the startup, bgwriter, autovacuum launcher, and
* slot sync worker tasks are not in this list. They are tracked via
StartupPID
* and other pid_t variables below. (Thus, there can't be more than one of any
* given "special" child process type. We use BackendList entries for any
@@ -3415,7 +3415,7 @@ CleanupBackend(int pid,
/*
* HandleChildCrash -- cleanup after failed backend, bgwriter, checkpointer,
- * walwriter, autovacuum, archiver, slot sync worker or background worker.
+ * walwriter, autovacuum, archiver, slot sync worker, or background worker.
*
* The objectives here are to clean up our local state about the child
* process, and to signal all other remaining children to quickdie.
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index e40cdbe4d9..04271ee703 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -6,8 +6,8 @@
* loaded as a dynamic module to avoid linking the main server binary with
* libpq.
*
- * Apart from walreceiver, the libpq-specific routines here are now being used
- * by logical replication workers and slot sync worker as well.
+ * Apart from walreceiver, the libpq-specific routines are now being used by
+ * logical replication workers and slot synchronization.
*
* Portions Copyright (c) 2010-2024, PostgreSQL Global Development Group
*
diff --git a/src/backend/replication/logical/slotsync.c
b/src/backend/replication/logical/slotsync.c
index 6492582156..56eb0ea11b 100644
--- a/src/backend/replication/logical/slotsync.c
+++ b/src/backend/replication/logical/slotsync.c
@@ -22,10 +22,10 @@
* which we can call pg_sync_replication_slots() periodically to perform
* syncs.
*
- * The slot sync worker worker waits for a period of time before the next
- * synchronization, with the duration varying based on whether any slots were
- * updated during the last cycle. Refer to the comments above
- * wait_for_slot_activity() for more details.
+ * The slot sync worker waits for some time before the next synchronization,
+ * with the duration varying based on whether any slots were updated during
+ * the last cycle. Refer to the comments above wait_for_slot_activity() for
+ * more details.
*
* Any standby synchronized slots will be dropped if they no longer need
* to be synchronized. See comment atop drop_local_obsolete_slots() for more
@@ -1449,9 +1449,8 @@ ShutDownSlotSync(void)
/*
* SlotSyncWorkerCanRestart
*
- * Returns true if the worker is allowed to restart if enough time has
- * passed (SLOTSYNC_RESTART_INTERVAL_SEC) since it was launched last.
- * Otherwise returns false.
+ * Returns true if enough time has passed (SLOTSYNC_RESTART_INTERVAL_SEC)
+ * since it was launched last. Otherwise returns false.
*
* This is a safety valve to protect against continuous respawn attempts if the
* worker is dying immediately at launch. Note that since we will retry to