patch some bug fix:part 1
This commit is contained in:
@ -155,10 +155,8 @@ int ObMultiTenant::init(ObAddr myaddr, double node_quota, int64_t times_of_worke
|
||||
|
||||
myaddr_ = myaddr;
|
||||
node_quota_ = node_quota;
|
||||
const int64_t total_reserved_quota = static_cast<int64_t>(
|
||||
GCONF.system_cpu_quota + GCONF.election_cpu_quota + GCONF.user_location_cpu_quota() +
|
||||
GCONF.sys_location_cpu_quota() + GCONF.root_location_cpu_quota() + GCONF.core_location_cpu_quota() +
|
||||
EXT_LOG_TENANT_CPU + OB_MONITOR_CPU + OB_SVR_BLACKLIST_CPU);
|
||||
const int64_t total_reserved_quota
|
||||
= static_cast<int64_t>(VIRTUAL_TENANTS_CPU_RESERVED_QUOTA);
|
||||
|
||||
int64_t init_workers_cnt =
|
||||
(static_cast<int64_t>(node_quota) + static_cast<int64_t>(GCONF.server_cpu_quota_min)) * DEFAULT_TIMES_OF_WORKERS +
|
||||
@ -732,10 +730,8 @@ int ObMultiTenant::get_tenant_cpu(const uint64_t tenant_id, double& min_cpu, dou
|
||||
void ObMultiTenant::set_workers_per_cpu(int64_t v)
|
||||
{
|
||||
times_of_workers_ = v;
|
||||
const int64_t total_reserved_quota = static_cast<int64_t>(
|
||||
GCONF.system_cpu_quota + GCONF.election_cpu_quota + GCONF.user_location_cpu_quota() +
|
||||
GCONF.sys_location_cpu_quota() + GCONF.root_location_cpu_quota() + GCONF.core_location_cpu_quota() +
|
||||
EXT_LOG_TENANT_CPU + OB_MONITOR_CPU + OB_SVR_BLACKLIST_CPU);
|
||||
const int64_t total_reserved_quota
|
||||
= static_cast<int64_t>(VIRTUAL_TENANTS_CPU_RESERVED_QUOTA);
|
||||
auto max_workers_cnt = static_cast<int64_t>(node_quota_) * times_of_workers_ +
|
||||
total_reserved_quota * static_cast<int64_t>(quota2token_) +
|
||||
static_cast<int64_t>(node_quota_) * 16;
|
||||
|
||||
@ -31,6 +31,13 @@ class ObRequest;
|
||||
}
|
||||
|
||||
namespace omt {
|
||||
#define VIRTUAL_TENANTS_CPU_RESERVED_QUOTA \
|
||||
(GCONF.system_cpu_quota \
|
||||
+ GCONF.election_cpu_quota \
|
||||
+ GCONF.user_location_cpu_quota() + GCONF.sys_location_cpu_quota() \
|
||||
+ GCONF.root_location_cpu_quota() + GCONF.core_location_cpu_quota() \
|
||||
+ EXT_LOG_TENANT_CPU + OB_MONITOR_CPU \
|
||||
+ OB_SVR_BLACKLIST_CPU + OB_DATA_CPU + OB_DTL_CPU + OB_RS_CPU + OB_DIAG_CPU)
|
||||
|
||||
struct ObCtxMemConfig {
|
||||
ObCtxMemConfig() : ctx_id_(0), idle_size_(0)
|
||||
|
||||
@ -403,6 +403,9 @@ int ObTenant::init()
|
||||
LOG_ERROR("tenant base init failed", K_(id), K(ret));
|
||||
}
|
||||
}
|
||||
if (OB_SUCCESS != ret && nullptr != multi_level_queue_) {
|
||||
common::ob_delete(multi_level_queue_);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -525,6 +528,9 @@ void ObTenant::destroy()
|
||||
LOG_WARN("remove tenant cgroup failed", K(tmp_ret), K_(id));
|
||||
}
|
||||
ObTenantBase::destory();
|
||||
if (nullptr != multi_level_queue_) {
|
||||
common::ob_delete(multi_level_queue_);
|
||||
}
|
||||
}
|
||||
|
||||
void ObTenant::set_unit_max_cpu(double cpu)
|
||||
|
||||
@ -89,6 +89,8 @@ ObThWorker* ObWorkerPool::alloc()
|
||||
worker = nullptr;
|
||||
LOG_ERROR("create worker fail", K(ret));
|
||||
}
|
||||
} else {
|
||||
LOG_ERROR("worker cnt larger than max cnt", K(worker_cnt_), K(max_cnt_));
|
||||
}
|
||||
}
|
||||
return worker;
|
||||
|
||||
Reference in New Issue
Block a user