From b4511b899dfce8470b04cba669b8b0da1b63c26f Mon Sep 17 00:00:00 2001 From: obdev Date: Tue, 11 Jul 2023 04:48:16 +0000 Subject: [PATCH] DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE need return correct baseline number load from plan cache --- deps/oblib/src/rpc/obrpc/ob_rpc_packet_list.h | 2 ++ src/share/ob_common_rpc_proxy.h | 1 + src/share/ob_rpc_struct.cpp | 11 +++++++++++ src/share/ob_rpc_struct.h | 12 ++++++++++++ 4 files changed, 26 insertions(+) diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_packet_list.h b/deps/oblib/src/rpc/obrpc/ob_rpc_packet_list.h index 24b76614d7..f186957211 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_packet_list.h +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_packet_list.h @@ -569,6 +569,8 @@ PCODE_DEF(OB_DTL_SEND, 0x5C0) PCODE_DEF(OB_DTL_FETCH, 0x5C1) PCODE_DEF(OB_DTL_BC_SEND, 0x5C2) PCODE_DEF(OB_PX_SEND_BLOOM_FILTER, 0x5C3) +PCODE_DEF(OB_LOAD_BASELINE_V2, 0x5C4) +PCODE_DEF(OB_ADMIN_LOAD_BASELINE_V2, 0x5C5) // election PCODE_DEF(OB_ELECTION, 0x601) PCODE_DEF(OB_ELECTION_RESPONSE, 0x602) diff --git a/src/share/ob_common_rpc_proxy.h b/src/share/ob_common_rpc_proxy.h index 86f7c5e318..b5d99ff125 100644 --- a/src/share/ob_common_rpc_proxy.h +++ b/src/share/ob_common_rpc_proxy.h @@ -136,6 +136,7 @@ public: RPC_S(PR5 accept_plan_baseline, obrpc::OB_RS_ACCEPT_PLAN_BASELINE, (ObModifyPlanBaselineArg)); RPC_S(PRD cancel_evolve_task, obrpc::OB_RS_CANCEL_EVOLVE_TASK, (ObModifyPlanBaselineArg)); RPC_S(PR5 admin_load_baseline, obrpc::OB_ADMIN_LOAD_BASELINE, (ObLoadPlanBaselineArg)); + RPC_S(PR5 admin_load_baseline_v2, obrpc::OB_ADMIN_LOAD_BASELINE_V2, (ObLoadPlanBaselineArg), ObLoadBaselineRes); // RPC_S(PRD drop_plan_baseline, obrpc::OB_DROP_PLAN_BASELINE, (ObDropPlanBaselineArg)); //----End of definitions for managing plan_baselines---- diff --git a/src/share/ob_rpc_struct.cpp b/src/share/ob_rpc_struct.cpp index 6bd65bb4d8..0608a6aa48 100755 --- a/src/share/ob_rpc_struct.cpp +++ b/src/share/ob_rpc_struct.cpp @@ -8592,5 +8592,16 @@ int ObBroadcastConsensusVersionArg::assign(const ObBroadcastConsensusVersionArg } OB_SERIALIZE_MEMBER(ObBroadcastConsensusVersionRes, ret_); + +int ObLoadBaselineRes::assign(const ObLoadBaselineRes &other) +{ + int ret = OB_SUCCESS; + if (this != &other) { + load_count_ = other.load_count_; + } + return ret; +} +OB_SERIALIZE_MEMBER(ObLoadBaselineRes, load_count_); + }//end namespace obrpc }//end namepsace oceanbase diff --git a/src/share/ob_rpc_struct.h b/src/share/ob_rpc_struct.h index 5ffe4c943f..abf5509a9c 100755 --- a/src/share/ob_rpc_struct.h +++ b/src/share/ob_rpc_struct.h @@ -9322,6 +9322,18 @@ private: int ret_; }; +struct ObLoadBaselineRes +{ + OB_UNIS_VERSION(1); +public: + ObLoadBaselineRes() + : load_count_(0) + {} + int assign(const ObLoadBaselineRes &other); + TO_STRING_KV(K_(load_count)); + uint64_t load_count_; +}; + }//end namespace obrpc }//end namespace oceanbase #endif