fix: large query send rpc should not set group id to pkt

This commit is contained in:
obdev
2023-03-02 16:20:57 +00:00
committed by ob-robot
parent 284a98ee20
commit b8ed723a78
2 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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))) {