From fa3ce00eed7fb2209f64b51298adfbcb7321b3ba Mon Sep 17 00:00:00 2001 From: xue_meng_en <1836611252@qq.com> Date: Fri, 25 Dec 2020 10:24:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E8=A1=A5=E4=B8=8D=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/storage/replication/walsender.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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.")));