From a313f8d0a1dabb7615e1b712acfab8ea73d77f20 Mon Sep 17 00:00:00 2001 From: obdev Date: Fri, 20 Sep 2024 06:51:52 +0000 Subject: [PATCH] fix update plan detective failed --- src/share/resource_manager/ob_resource_manager_proxy.cpp | 7 ++++++- src/share/resource_manager/ob_resource_plan_info.cpp | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/share/resource_manager/ob_resource_manager_proxy.cpp b/src/share/resource_manager/ob_resource_manager_proxy.cpp index 460f3eaaa..408c616db 100644 --- a/src/share/resource_manager/ob_resource_manager_proxy.cpp +++ b/src/share/resource_manager/ob_resource_manager_proxy.cpp @@ -1080,9 +1080,10 @@ int ObResourceManagerProxy::update_plan_directive( LOG_USER_ERROR(OB_ERR_PLAN_DIRECTIVE_NOT_EXIST, plan.length(), plan.ptr(), group.length(), group.ptr()); } else if (comments.is_null() && mgmt_p1.is_null() && utilization_limit.is_null() && - min_iops.is_null() && max_iops.is_null() && weight_iops.is_null()) { + min_iops.is_null() && max_iops.is_null() && weight_iops.is_null() && max_net_bandwidth.is_null() && net_bandwidth_weight.is_null()) { // 没有指定任何有效参数,什么都不做,也不报错。兼容 Oracle 行为。 ret = OB_SUCCESS; + LOG_WARN("did not receive any valid parameter", K(ret)); } else if (OB_FAIL(sql.assign_fmt("UPDATE /* UPDATE_PLAN_DIRECTIVE */ %s SET ", tname))) { STORAGE_LOG(WARN, "append table name failed, ", K(ret)); } else { @@ -1179,6 +1180,8 @@ int ObResourceManagerProxy::update_plan_directive( LOG_WARN("fail get percentage", K(ret)); } else if (OB_FAIL(sql.append_fmt("%s MAX_NET_BANDWIDTH=%ld", comma, v))) { LOG_WARN("fail append value", K(ret)); + } else { + comma = ","; } } } @@ -1188,6 +1191,8 @@ int ObResourceManagerProxy::update_plan_directive( LOG_WARN("fail get percentage", K(ret)); } else if (OB_FAIL(sql.append_fmt("%s NET_BANDWIDTH_WEIGHT=%ld", comma, v))) { LOG_WARN("fail append value", K(ret)); + } else { + comma = ","; } } } diff --git a/src/share/resource_manager/ob_resource_plan_info.cpp b/src/share/resource_manager/ob_resource_plan_info.cpp index d0a69c291..517fa93b8 100644 --- a/src/share/resource_manager/ob_resource_plan_info.cpp +++ b/src/share/resource_manager/ob_resource_plan_info.cpp @@ -11,7 +11,6 @@ */ #define USING_LOG_PREFIX SHARE - #include "ob_resource_plan_info.h" using namespace oceanbase::common;