diff --git a/src/gausskernel/storage/replication/walsender.cpp b/src/gausskernel/storage/replication/walsender.cpp index 671e7a8d0..39654b28e 100755 --- a/src/gausskernel/storage/replication/walsender.cpp +++ b/src/gausskernel/storage/replication/walsender.cpp @@ -2786,7 +2786,13 @@ static int WalSndLoop(WalSndSendDataCallback send_data) marked_stream_replication = u_sess->attr.attr_storage.enable_stream_replication; ProcessConfigFile(PGC_SIGHUP); SyncRepInitConfig(); - sync_config_needed = true; + if (g_instance.attr.attr_common.sync_config_strategy == ALL_NODE || + (g_instance.attr.attr_common.sync_config_strategy == ONLY_SYNC_NODE && + t_thrd.walsender_cxt.MyWalSnd->sync_standby_priority > 0)) { + sync_config_needed = true; + } else { + sync_config_needed = false; + } } /* switchover is forbidden when catchup thread in progress */ @@ -2906,10 +2912,7 @@ static int WalSndLoop(WalSndSendDataCallback send_data) } } - if (sync_config_needed && - (g_instance.attr.attr_common.sync_config_strategy == ALL_NODE || - (g_instance.attr.attr_common.sync_config_strategy == ONLY_SYNC_NODE && - t_thrd.walsender_cxt.MyWalSnd->sync_standby_priority > 0))) { + if (sync_config_needed) { if (t_thrd.walsender_cxt.walsender_shutdown_requested) { if (!AM_WAL_DB_SENDER && !SendConfigFile(t_thrd.walsender_cxt.gucconf_file)) ereport(LOG, (errmsg("failed to send config to the peer when walsender shutdown.")));