From 8bd9721cfbe185fe9a5235e3119a229ab02a1e44 Mon Sep 17 00:00:00 2001 From: maosy <630014370@qq.com> Date: Tue, 17 Aug 2021 14:30:27 +0800 Subject: [PATCH] modify daily_merge error and forbid modify cluster_id and cluster --- src/rootserver/ob_daily_merge_scheduler.cpp | 11 +++++++++-- src/share/config/ob_server_config.h | 2 ++ src/sql/resolver/cmd/ob_alter_system_resolver.cpp | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/rootserver/ob_daily_merge_scheduler.cpp b/src/rootserver/ob_daily_merge_scheduler.cpp index f530149540..aa3e822e53 100644 --- a/src/rootserver/ob_daily_merge_scheduler.cpp +++ b/src/rootserver/ob_daily_merge_scheduler.cpp @@ -1400,8 +1400,15 @@ void ObDailyMergeScheduler::check_merge_timeout() } // end FOREACH(zone, zones) const int64_t MAX_NO_MERGE_INTERVAL = 36 * 3600 * 1000 * 1000L; // 36 hours if (now - max_last_merge_merged_time > MAX_NO_MERGE_INTERVAL && - now - max_start_merge_time > MAX_NO_MERGE_INTERVAL) { - LOG_ERROR("long time no daily merge, please check it", K(ret)); + now - max_start_merge_time > MAX_NO_MERGE_INTERVAL && !config_->major_freeze_duty_time.disable()) { + // if cluster can not daily merge, no need + if (REACH_TIME_INTERVAL(10 * 60 * 1000 * 1000)) { + LOG_ERROR("long time no daily merge, please check it", + KR(ret), + K(max_last_merge_merged_time), + K(max_start_merge_time), + K(zones)); + } } } } diff --git a/src/share/config/ob_server_config.h b/src/share/config/ob_server_config.h index 24beb1196f..7d87be9a55 100644 --- a/src/share/config/ob_server_config.h +++ b/src/share/config/ob_server_config.h @@ -50,6 +50,8 @@ const char* const SSL_EXTERNAL_KMS_INFO = "ssl_external_kms_info"; const char* const ENABLE_ONE_PHASE_COMMIT = "enable_one_phase_commit"; const char* const CLOG_DISK_USAGE_LIMIT_PERCENTAGE = "clog_disk_usage_limit_percentage"; const char* const CLOG_DISK_UTILIZATION_THRESHOLD = "clog_disk_utilization_threshold"; +const char *const CLUSTER_ID = "cluster_id"; +const char *const CLUSTER_NAME = "cluster"; class ObServerConfig : public ObCommonConfig { public: diff --git a/src/sql/resolver/cmd/ob_alter_system_resolver.cpp b/src/sql/resolver/cmd/ob_alter_system_resolver.cpp index 3825ced04f..4475a38d08 100644 --- a/src/sql/resolver/cmd/ob_alter_system_resolver.cpp +++ b/src/sql/resolver/cmd/ob_alter_system_resolver.cpp @@ -1724,6 +1724,10 @@ int ObSetConfigResolver::resolve(const ParseNode& parse_tree) if (OB_FAIL(check_enable_log_archive(item.value_.str()))) { LOG_WARN("cannot set enable log archive true", K(ret)); } + } else if (0 == STRCMP(item.name_.ptr(), CLUSTER_ID)) { + ret = OB_OP_NOT_ALLOW; + LOG_WARN("cluster_id is not allowed to modify"); + LOG_USER_ERROR(OB_OP_NOT_ALLOW, "alter the parameter cluster_id"); } } } -- GitLab