Revert fix resource manager uppercase issues
This commit is contained in:
parent
70b2e8f730
commit
09b5402e87
@ -1999,8 +1999,7 @@ void ObTenant::periodically_check()
|
||||
void ObTenant::check_resource_manager_plan()
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObString plan;
|
||||
ObString up_plan;
|
||||
ObString plan_name;
|
||||
ObResourcePlanManager &plan_mgr = G_RES_MGR.get_plan_mgr();
|
||||
ObResourceMappingRuleManager &rule_mgr = G_RES_MGR.get_mapping_rule_mgr();
|
||||
ObResourceColMappingRuleManager &col_rule_mgr = G_RES_MGR.get_col_mapping_rule_mgr();
|
||||
@ -2012,28 +2011,26 @@ void ObTenant::check_resource_manager_plan()
|
||||
id_,
|
||||
SYS_VAR_RESOURCE_MANAGER_PLAN,
|
||||
allocator,
|
||||
plan))) {
|
||||
LOG_WARN("fail get tenant variable", K(id_), K(plan), K(ret));
|
||||
plan_name))) {
|
||||
LOG_WARN("fail get tenant variable", K(id_), K(plan_name), K(ret));
|
||||
// skip
|
||||
} else if (OB_FAIL(ob_simple_low_to_up(allocator, plan, up_plan))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(rule_mgr.refresh_group_mapping_rule(id_, up_plan))) {
|
||||
} else if (OB_FAIL(rule_mgr.refresh_group_mapping_rule(id_, plan_name))) {
|
||||
LOG_WARN("refresh group id name mapping rule fail."
|
||||
"Tenant resource isolation may not work",
|
||||
K(id_), K(up_plan), K(ret));
|
||||
} else if (OB_FAIL(plan_mgr.refresh_resource_plan(id_, up_plan))) {
|
||||
K(id_), K(plan_name), K(ret));
|
||||
} else if (OB_FAIL(plan_mgr.refresh_resource_plan(id_, plan_name))) {
|
||||
LOG_WARN("refresh resource plan fail."
|
||||
"Tenant resource isolation may not work",
|
||||
K(id_), K(up_plan), K(ret));
|
||||
} else if (OB_FAIL(rule_mgr.refresh_resource_mapping_rule(id_, up_plan))) {
|
||||
K(id_), K(plan_name), K(ret));
|
||||
} else if (OB_FAIL(rule_mgr.refresh_resource_mapping_rule(id_, plan_name))) {
|
||||
LOG_WARN("refresh resource mapping rule fail."
|
||||
"Tenant resource isolation may not work",
|
||||
K(id_), K(up_plan), K(ret));
|
||||
K(id_), K(plan_name), K(ret));
|
||||
} else if (OB_FAIL(col_rule_mgr.refresh_resource_column_mapping_rule(id_, get<ObPlanCache*>(),
|
||||
up_plan))) {
|
||||
plan_name))) {
|
||||
LOG_WARN("refresh resource column mapping rule fail."
|
||||
"Tenant resource isolation may not work",
|
||||
K(id_), K(up_plan), K(ret));
|
||||
K(id_), K(plan_name), K(ret));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,16 +49,13 @@ int ObPlDBMSResourceManager::create_plan(
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
ObString up_plan;
|
||||
if (OB_UNLIKELY(0 == plan.length())) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("name of plan cannot be null or empty", K(ret));
|
||||
// plan 肯定存在,所以可以 get_string 读取,
|
||||
// COMMENT 是可选的可能为 null,所以传入 ObObj
|
||||
} else if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), plan, up_plan))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(proxy.create_plan(tenant_id, up_plan, params.at(COMMENT)))) {
|
||||
LOG_WARN("fail create plan", K(tenant_id), K(up_plan), K(ret));
|
||||
} else if (OB_FAIL(proxy.create_plan(tenant_id, plan, params.at(COMMENT)))) {
|
||||
LOG_WARN("fail create plan", K(tenant_id), K(plan), K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -94,11 +91,8 @@ int ObPlDBMSResourceManager::delete_plan(
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
ObString up_plan;
|
||||
if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), plan, up_plan))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(proxy.delete_plan(tenant_id, up_plan))) {
|
||||
LOG_WARN("fail delete plan", K(tenant_id), K(up_plan), K(ret));
|
||||
if (OB_FAIL(proxy.delete_plan(tenant_id, plan))) {
|
||||
LOG_WARN("fail delete plan", K(tenant_id), K(plan), K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -134,20 +128,17 @@ int ObPlDBMSResourceManager::create_consumer_group(
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
ObString up_consumer_group;
|
||||
if (OB_UNLIKELY(0 == consumer_group.length())) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("name of consumer group cannot be null or empty", K(ret));
|
||||
// consumer_group 肯定存在,所以可以 get_string 读取,
|
||||
// COMMENT 是可选的可能为 null,所以传入 ObObj
|
||||
// consumer_group 肯定存在,所以可以 get_string 读取,
|
||||
// COMMENT 是可选的可能为 null,所以传入 ObObj
|
||||
} else if (!GCTX.cgroup_ctrl_->is_valid_group_name(consumer_group)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_USER_ERROR(OB_INVALID_ARGUMENT, "invalid consumer group name");
|
||||
LOG_WARN("invalid consumer group name", K(ret), K(consumer_group));
|
||||
} else if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), consumer_group, up_consumer_group))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(proxy.create_consumer_group(tenant_id, up_consumer_group, params.at(COMMENT)))) {
|
||||
LOG_WARN("fail create consumer_group", K(tenant_id), K(up_consumer_group), K(ret));
|
||||
} else if (OB_FAIL(proxy.create_consumer_group(tenant_id, consumer_group, params.at(COMMENT)))) {
|
||||
LOG_WARN("fail create consumer_group", K(tenant_id), K(consumer_group), K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -183,11 +174,8 @@ int ObPlDBMSResourceManager::delete_consumer_group(
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
ObString up_consumer_group;
|
||||
if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), consumer_group, up_consumer_group))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(proxy.delete_consumer_group(tenant_id, up_consumer_group))) {
|
||||
LOG_WARN("fail delete consumer_group", K(tenant_id), K(up_consumer_group), K(ret));
|
||||
if (OB_FAIL(proxy.delete_consumer_group(tenant_id, consumer_group))) {
|
||||
LOG_WARN("fail delete consumer_group", K(tenant_id), K(consumer_group), K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -236,16 +224,10 @@ int ObPlDBMSResourceManager::create_plan_directive(
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
ObString up_group;
|
||||
ObString up_plan;
|
||||
tenant_id = sess->get_effective_tenant_id();
|
||||
if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), plan, up_plan))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), group, up_group))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(proxy.create_plan_directive(tenant_id,
|
||||
up_plan,
|
||||
up_group,
|
||||
if (OB_FAIL(proxy.create_plan_directive(tenant_id,
|
||||
plan,
|
||||
group,
|
||||
params.at(ObPlanDirectiveParamType::COMMENT),
|
||||
params.at(ObPlanDirectiveParamType::MGMT_P1),
|
||||
params.at(ObPlanDirectiveParamType::UTILIZATION_LIMIT),
|
||||
@ -254,7 +236,7 @@ int ObPlDBMSResourceManager::create_plan_directive(
|
||||
params.at(ObPlanDirectiveParamType::WEIGHT_IOPS),
|
||||
max_net_bandwidht_obj,
|
||||
net_bandwidth_weight_obj))) {
|
||||
LOG_WARN("fail create plan directive", K(tenant_id), K(up_plan), K(up_group), K(ret));
|
||||
LOG_WARN("fail create plan directive", K(tenant_id), K(plan), K(group), K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -294,14 +276,8 @@ int ObPlDBMSResourceManager::delete_plan_directive(
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
ObString up_group;
|
||||
ObString up_plan;
|
||||
if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), group, up_group))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), plan, up_plan))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(proxy.delete_plan_directive(tenant_id, up_plan, up_group))) {
|
||||
LOG_WARN("fail create plan", K(tenant_id), K(up_plan), K(up_group), K(ret));
|
||||
if (OB_FAIL(proxy.delete_plan_directive(tenant_id, plan, group))) {
|
||||
LOG_WARN("fail create plan", K(tenant_id), K(plan), K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -349,16 +325,10 @@ int ObPlDBMSResourceManager::update_plan_directive(
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
ObString up_group;
|
||||
ObString up_plan;
|
||||
tenant_id = sess->get_effective_tenant_id();
|
||||
if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), group, up_group))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), plan, up_plan))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(proxy.update_plan_directive(tenant_id,
|
||||
up_plan,
|
||||
up_group,
|
||||
if (OB_FAIL(proxy.update_plan_directive(tenant_id,
|
||||
plan,
|
||||
group,
|
||||
params.at(ObPlanDirectiveParamType::COMMENT),
|
||||
params.at(ObPlanDirectiveParamType::MGMT_P1),
|
||||
params.at(ObPlanDirectiveParamType::UTILIZATION_LIMIT),
|
||||
@ -367,7 +337,7 @@ int ObPlDBMSResourceManager::update_plan_directive(
|
||||
params.at(ObPlanDirectiveParamType::WEIGHT_IOPS),
|
||||
max_net_bandwidht_obj,
|
||||
net_bandwidth_weight_obj))) {
|
||||
LOG_WARN("fail update plan directive", K(tenant_id), K(up_plan), K(up_group), K(ret));
|
||||
LOG_WARN("fail update plan directive", K(tenant_id), K(plan), K(group), K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -414,22 +384,12 @@ int ObPlDBMSResourceManager::set_consumer_group_mapping(
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
ObString up_value = value;
|
||||
if (0 == attr.case_compare("function")) {
|
||||
if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), value, up_value))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
}
|
||||
}
|
||||
ObString up_attr;
|
||||
ObString up_group;
|
||||
if (OB_FAIL(ret)) {
|
||||
// do nothing
|
||||
} else if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), attr, up_attr))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(), group, up_group))) {
|
||||
LOG_WARN("plan change to upper string failed", K(ret));
|
||||
} else if (OB_FAIL(proxy.replace_mapping_rule(tenant_id, up_attr, up_value, up_group, *sess))) {
|
||||
LOG_WARN("fail update plan directive", K(tenant_id), K(up_attr), K(up_value), K(up_group), K(ret));
|
||||
if (OB_FAIL(proxy.replace_mapping_rule(tenant_id,
|
||||
attr,
|
||||
value,
|
||||
group,
|
||||
*sess))) {
|
||||
LOG_WARN("fail update plan directive", K(tenant_id), K(attr), K(value), K(group), K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user