diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index bfa2a13377..a9ff6acd31 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -365,19 +365,18 @@ postgres=# select * from pg_logical_slot_get_changes('regression_slot', NULL, NU
Replication Slot Synchronization
The logical replication slots on the primary can be synchronized to
- the hot standby by enabling failover during slot
- creation (e.g., using the failover parameter of
+ the hot standby by using the failover parameter of
pg_create_logical_replication_slot, or
using the
failover option of
- CREATE SUBSCRIPTION), and then calling
+ CREATE SUBSCRIPTION during slot creation, and then calling
pg_sync_replication_slots
on the standby. For the synchronization to work, it is mandatory to
- have a physical replication slot between the primary and the standby (e.g.,
+ have a physical replication slot between the primary and the standby aka
primary_slot_name
- should be configured on the standby), and
+ should be configured on the standby, and
hot_standby_feedback
must be enabled on the standby. It is also necessary to specify a valid
dbname in the
diff --git a/src/backend/replication/logical/slotsync.c b/src/backend/replication/logical/slotsync.c
index feb04e1451..eb238cef92 100644
--- a/src/backend/replication/logical/slotsync.c
+++ b/src/backend/replication/logical/slotsync.c
@@ -304,6 +304,12 @@ reserve_wal_for_local_slot(XLogRecPtr restart_lsn)
* number. However, if no WAL segment files have been removed by a
* checkpoint since startup, we need to search for the oldest segment
* file from the current timeline existing in XLOGDIR.
+ *
+ * XXX: Currently, we are searching for the oldest segment in the
+ * current timeline as there is less chance of the slot's restart_lsn
+ * from being some prior timeline, and even if it happens, in the worst
+ * case, we will wait to sync till the slot's restart_lsn moved to the
+ * current timeline.
*/
oldest_segno = XLogGetLastRemovedSegno() + 1;
@@ -685,11 +691,10 @@ synchronize_slots(WalReceiverConn *wrconn)
}
/*
- * Checks the primary server info.
+ * Checks the remote server info.
*
- * Using the specified primary server connection, check whether we are a
- * cascading standby. It also validates primary_slot_name for non-cascading
- * standbys.
+ * We ensure that the 'primary_slot_name' exists on the remote server and
+ * the remote server is not a standby node.
*/
static void
check_primary_info(WalReceiverConn *wrconn, int elevel)