From f0da14a1facaf36fe0b39bfae3946290ef5e56ab Mon Sep 17 00:00:00 2001 From: zhangao_za <18829237393@163.com> Date: Tue, 19 Sep 2023 10:19:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=8C=E9=9B=86=E7=BE=A4=E4=B8=8B=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0backup=5Fopen=E5=8F=82=E6=95=B0reload=E7=94=9F?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cm_agent/cma_common.cpp | 8 ++++++-- src/cm_server/cms_monitor_main.cpp | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/cm_agent/cma_common.cpp b/src/cm_agent/cma_common.cpp index 0098079..d428f0c 100644 --- a/src/cm_agent/cma_common.cpp +++ b/src/cm_agent/cma_common.cpp @@ -358,6 +358,9 @@ void ReloadParametersFromConfig() } g_doradoClusterMode = (DoradoClusterMode)get_uint32_value_from_config(configDir, "dorado_cluster_mode", SS_DORADO_NULL); + if (agent_backup_open == CLUSTER_OBS_STANDBY) { + agent_backup_open = (ClusterRole)get_uint32_value_from_config(configDir, "agent_backup_open", CLUSTER_PRIMARY); + } log_threshold_check_interval = get_uint32_value_from_config(configDir, "log_threshold_check_interval", log_threshold_check_interval); undocumentedVersion = get_uint32_value_from_config(configDir, "upgrade_from", 0); @@ -410,7 +413,7 @@ void ReloadParametersFromConfigfile() " enableLogCompress=%s, security_mode=%s, incremental_build=%d, unix_socket_directory=%s, " #ifndef ENABLE_MULTIPLE_NODES "enable_e2e_rto=%u, disaster_recovery_type=%d, environment_threshold=%s, " - "db_service_vip=%s, enable_fence_dn=%s, dorado_cluster_mode=%d\n", + "db_service_vip=%s, enable_fence_dn=%s, dorado_cluster_mode=%d, agent_backup_open=%d\n", #else "enable_e2e_rto=%u, disaster_recovery_type=%d, environment_threshold=%s\n", #endif @@ -441,7 +444,8 @@ void ReloadParametersFromConfigfile() g_environmentThreshold, g_dbServiceVip, g_enableFenceDn, - g_doradoClusterMode); + g_doradoClusterMode, + agent_backup_open); #else g_environmentThreshold); #endif diff --git a/src/cm_server/cms_monitor_main.cpp b/src/cm_server/cms_monitor_main.cpp index d3cef87..55f2f4a 100644 --- a/src/cm_server/cms_monitor_main.cpp +++ b/src/cm_server/cms_monitor_main.cpp @@ -355,6 +355,9 @@ static void ReloadParametersFromConfigfile() GetTwoNodesArbitrateParams(); } + if (backup_open == CLUSTER_OBS_STANDBY) { + backup_open = (ClusterRole)get_int_value_from_config(configDir, "backup_open", 0); + } #ifdef ENABLE_MULTIPLE_NODES write_runlog(LOG, @@ -386,13 +389,13 @@ static void ReloadParametersFromConfigfile() "datastorage_threshold_check_interval=%d,\n" " max_datastorage_threshold_check=%d, enableSetReadOnly=%s, enableSetReadOnlyThreshold=%u, " "switch_rto=%d, force_promote=%d, cluster_starting_aribt_delay=%u, enable_e2e_rto=%u, " - "g_delayArbiTime=%u, g_clusterArbiTime=%d, wait_static_primary_times=%u.\n", + "g_delayArbiTime=%u, g_clusterArbiTime=%d, wait_static_primary_times=%u, backup_open=%d.\n", log_min_messages, maxLogFileSize, sys_log_path, g_alarmComponentPath, g_alarmReportInterval, instance_heartbeat_timeout, g_ddbArbicfg.haHeartBeatTimeOut, cmserver_self_vote_timeout, g_ddbArbicfg.haStatusInterval, cmserver_ha_connect_timeout, instance_failover_delay_timeout, datastorage_threshold_check_interval, max_datastorage_threshold_check, g_enableSetReadOnly, g_readOnlyThreshold, switch_rto, force_promote, g_clusterStartingArbitDelay, - g_enableE2ERto, g_delayArbiTime, g_clusterArbiTime, g_waitStaticPrimaryTimes); + g_enableE2ERto, g_delayArbiTime, g_clusterArbiTime, g_waitStaticPrimaryTimes, backup_open); #endif }