diff --git a/src/gausskernel/storage/replication/syncrep.cpp b/src/gausskernel/storage/replication/syncrep.cpp index a2fdf69b..6ae81d7b 100644 --- a/src/gausskernel/storage/replication/syncrep.cpp +++ b/src/gausskernel/storage/replication/syncrep.cpp @@ -623,6 +623,9 @@ bool SyncRepGetSyncRecPtr(XLogRecPtr *receivePtr, XLogRecPtr *writePtr, XLogRecP * or there are not enough synchronous standbys. * but in a particular scenario, when most_available_sync is true, primary only wait the alive sync standbys * if list_length(sync_standbys) doesn't satisfy t_thrd.syncrep_cxt.SyncRepConfig->num_sync. + * + * All synchronous standbys are allowed to disconnect from the host + * only when the maximum available mode is on */ if ((!(*am_sync) && check_am_sync) || t_thrd.syncrep_cxt.SyncRepConfig == NULL || (!t_thrd.walsender_cxt.WalSndCtl->most_available_sync && diff --git a/src/gausskernel/storage/replication/walsender.cpp b/src/gausskernel/storage/replication/walsender.cpp index b02c6993..8392f901 100644 --- a/src/gausskernel/storage/replication/walsender.cpp +++ b/src/gausskernel/storage/replication/walsender.cpp @@ -3209,6 +3209,9 @@ static int WalSndLoop(WalSndSendDataCallback send_data) } else if (t_thrd.syncrep_cxt.SyncRepConfig == NULL || (t_thrd.walsender_cxt.WalSndCtl->most_available_sync && list_length(SyncRepGetSyncStandbys(&amSync)) == 0)) { + /* + * This step is used to deal with the situation that synchronous standbys are not set. + */ ArchiveXlogOnStandby(t_thrd.walsender_cxt.MyWalSnd->flush); } else { ereport(WARNING, (errcode(ERRCODE_WARNING),