fix: add tenant config check when use tenant config for px acquire

This commit is contained in:
obdev
2023-01-28 16:27:17 +08:00
committed by ob-robot
parent f2648703a3
commit a7753ea302

View File

@ -197,8 +197,13 @@ void ObPxSubAdmission::acquire(int64_t max, int64_t min, int64_t &acquired_cnt)
LOG_ERROR("Oooops! can't find tenant. Unexpected!", KP(worker), K(max), K(min)); LOG_ERROR("Oooops! can't find tenant. Unexpected!", KP(worker), K(max), K(min));
} else { } else {
oceanbase::omt::ObTenantConfigGuard tenant_config(TENANT_CONF(tenant->id())); oceanbase::omt::ObTenantConfigGuard tenant_config(TENANT_CONF(tenant->id()));
if (!tenant_config.is_valid()) {
LOG_WARN("get tenant config failed, use default cpu_quota_concurrency");
upper_bound = tenant->unit_min_cpu() * 4;
} else {
upper_bound = tenant->unit_min_cpu() * tenant_config->cpu_quota_concurrency; upper_bound = tenant->unit_min_cpu() * tenant_config->cpu_quota_concurrency;
} }
}
acquired_cnt = std::min(max, upper_bound); acquired_cnt = std::min(max, upper_bound);
} }