From 7035d791b4ef7da65caaafd0ceebd5f4082ef9eb Mon Sep 17 00:00:00 2001 From: hnwyllmm Date: Fri, 25 Mar 2022 18:09:49 +0800 Subject: [PATCH] udpate omti.worker_pool while updating cpu_count config --- src/observer/ob_server_reload_config.cpp | 1 + src/observer/omt/ob_multi_tenant.cpp | 5 +++++ src/observer/omt/ob_multi_tenant.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/observer/ob_server_reload_config.cpp b/src/observer/ob_server_reload_config.cpp index 3f470e8da2..8f08bfc3ae 100644 --- a/src/observer/ob_server_reload_config.cpp +++ b/src/observer/ob_server_reload_config.cpp @@ -327,6 +327,7 @@ int ObServerReloadConfig::operator()() share::ObTaskController::get().set_log_rate_limit(GCONF.syslog_io_bandwidth_limit.get_value()); if (nullptr != GCTX.omt_) { + GCTX.omt_->set_node_quota(GCONF.cpu_count.get_value()); GCTX.omt_->set_workers_per_cpu(GCONF.workers_per_cpu_quota.get_value()); } diff --git a/src/observer/omt/ob_multi_tenant.cpp b/src/observer/omt/ob_multi_tenant.cpp index 48619f5029..3cd0ff28a1 100644 --- a/src/observer/omt/ob_multi_tenant.cpp +++ b/src/observer/omt/ob_multi_tenant.cpp @@ -744,6 +744,11 @@ void ObMultiTenant::set_workers_per_cpu(int64_t v) LOG_INFO("set max workers", K(max_workers_cnt)); } +void ObMultiTenant::set_node_quota(double node_quota) +{ + node_quota_ = node_quota; +} + void ObMultiTenant::run1() { lib::set_thread_name("MultiTenant"); diff --git a/src/observer/omt/ob_multi_tenant.h b/src/observer/omt/ob_multi_tenant.h index a0620387b8..6428415226 100644 --- a/src/observer/omt/ob_multi_tenant.h +++ b/src/observer/omt/ob_multi_tenant.h @@ -117,6 +117,7 @@ public: inline bool has_synced() const; void set_workers_per_cpu(int64_t v); + void set_node_quota(double node_quota); protected: void run1(); -- GitLab