From 65d110bf4450d161917d52ebd3ae0581113f22b9 Mon Sep 17 00:00:00 2001 From: wangbowen Date: Sat, 14 Sep 2024 14:09:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3reload=5Facl=5Fcaches?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- storage/tianchi/ctc_meta_data.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/storage/tianchi/ctc_meta_data.cc b/storage/tianchi/ctc_meta_data.cc index 1c5d375..ec6ab12 100644 --- a/storage/tianchi/ctc_meta_data.cc +++ b/storage/tianchi/ctc_meta_data.cc @@ -397,13 +397,24 @@ static typename std::enable_if::type bool error = false; T *thd = nullptr; - uint64_t thd_key = tse_get_conn_key(tch->inst_id, tch->thd_id, true); - ctc_init_thd(&thd, thd_key); - + if (broadcast_req->is_dcl == true) { - reload_acl_caches(thd, false); + thd = new (std::nothrow) THD; + my_thread_init(); + thd->set_new_thread_id(); + thd->thread_stack = (char *)&thd; + thd->store_globals(); + thd->set_query("tse_mdl_thd_notify", 18); + error = reload_acl_caches(thd, false); tse_log_system("[TSE_INVALID_DD]: remote invalidate acl cache, mysql_inst_id=%u", broadcast_req->mysql_inst_id); + + Release_all_ctc_explicit_locks lock_visitor; + thd->mdl_context.release_locks(&lock_visitor); + thd->release_resources(); + delete thd; } else { + uint64_t thd_key = tse_get_conn_key(tch->inst_id, tch->thd_id, true); + ctc_init_thd(&thd, thd_key); invalidate_obj_entry_t *obj = NULL; uint32_t offset = 0; char *buff = broadcast_req->buff; @@ -445,9 +456,9 @@ static typename std::enable_if::type for (auto invalidate_it : invalidate_schema_list) { error = invalidate_schema(thd, invalidate_it->first); } + thd->restore_globals(); } - thd->restore_globals(); my_thread_end(); tse_log_system("[TSE_INVALID_DD]: remote invalidate dd cache success, mysql_inst_id=%u", broadcast_req->mysql_inst_id); -- Gitee