fix wrong cpu_capacity in __all_virtual_server after cpu_count changing

This commit is contained in:
nroskill
2023-01-06 11:15:32 +00:00
committed by ob-robot
parent 44745724fc
commit 2cfa340452
9 changed files with 9 additions and 61 deletions

View File

@ -1728,24 +1728,7 @@ int ObServer::init_multi_tenant()
{
int ret = OB_SUCCESS;
// get node cpu count from sysconf if node_cpu_count config isn't
// specified.
int64_t node_cpu_count = get_cpu_num();
if (GCONF.cpu_count > "0") {
node_cpu_count = GCONF.cpu_count;
LOG_INFO("calc NODE CPU COUNT using config(node_cpu_count) for test",
K(node_cpu_count));
} else {
LOG_INFO("calc NODE CPU COUNT using sysconf function",
K(node_cpu_count));
}
const int64_t cpu_count = node_cpu_count;
const int64_t times_of_workers = GCONF.workers_per_cpu_quota;
if (OB_FAIL(multi_tenant_.init(self_addr_,
static_cast<double>(cpu_count),
times_of_workers,
&sql_proxy_))) {
LOG_ERROR("init multi tenant fail", KR(ret));