添加相应注释

This commit is contained in:
luozihao 2021-05-14 12:45:07 +08:00
parent 79eb60ec65
commit 98ea2c0c6d
2 changed files with 6 additions and 0 deletions

View File

@ -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 &&

View File

@ -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),