From b8ed723a78d9d5571f22b6fb6d4ea10c03164722 Mon Sep 17 00:00:00 2001 From: obdev Date: Thu, 2 Mar 2023 16:20:57 +0000 Subject: [PATCH] fix: large query send rpc should not set group id to pkt --- deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp | 8 +++++++- src/observer/omt/ob_tenant.cpp | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp index 263aed0133..09d96c82d2 100644 --- a/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp +++ b/deps/oblib/src/rpc/obrpc/ob_rpc_proxy.cpp @@ -173,7 +173,13 @@ int ObRpcProxy::init_pkt( // For request, src_cluster_id must be the cluster_id of this cluster, directly hard-coded pkt->set_src_cluster_id(src_cluster_id_); pkt->set_unis_version(0); - pkt->set_group_id((0 != get_group_id()) ? get_group_id() : this_worker().get_group_id()); + if (0 != get_group_id()) { + pkt->set_group_id(get_group_id()); + } else if (this_worker().get_group_id() == 100) { + pkt->set_group_id(0); + } else { + pkt->set_group_id(this_worker().get_group_id()); + } if (need_increment_request_level(pcode)) { if (this_worker().get_worker_level() == INT32_MAX) { // The inner sql request is not sent from the tenant thread, so the worker level is still the initial value, given // inner sql a special nesting level diff --git a/src/observer/omt/ob_tenant.cpp b/src/observer/omt/ob_tenant.cpp index c7e802f181..32634e04e8 100644 --- a/src/observer/omt/ob_tenant.cpp +++ b/src/observer/omt/ob_tenant.cpp @@ -1461,8 +1461,10 @@ int ObTenant::lq_yield(ObThWorker &w) { int ret = OB_SUCCESS; ATOMIC_INC(&tt_large_quries_); - if (!cgroup_ctrl_.is_valid() && w.get_group_id() == share::OBCG_LQ) { - lq_wait(w); + if (!cgroup_ctrl_.is_valid()) { + if (w.get_group_id() == share::OBCG_LQ) { + lq_wait(w); + } } else if (w.is_lq_yield()) { // avoid duplicate change group } else if (OB_FAIL(cgroup_ctrl_.add_thread_to_cgroup(w.get_tid(), id_, OBCG_LQ))) {