From f0689534db240a2eeaadb3eabd2c81e943324ef8 Mon Sep 17 00:00:00 2001 From: yuanyazhi Date: Wed, 4 Jun 2025 15:33:34 +0800 Subject: [PATCH] fix --- storage/ctc/ctc_meta_data.cc | 12 ++++++++++++ storage/ctc/ha_ctc.h | 1 + 2 files changed, 13 insertions(+) diff --git a/storage/ctc/ctc_meta_data.cc b/storage/ctc/ctc_meta_data.cc index 89207c1..586182c 100644 --- a/storage/ctc/ctc_meta_data.cc +++ b/storage/ctc/ctc_meta_data.cc @@ -430,6 +430,10 @@ template static typename std::enable_if::type ctc_invalidate_mysql_dd_cache_impl(ctc_handler_t *tch, ctc_invalidate_broadcast_request *broadcast_req, int *err_code) { UNUSED_PARAM(err_code); + if (!is_work_flow()) { + ctc_log_system("[ctc_invalidate_mysql_dd_cache_impl]: mysqld is not started."); + return 0; + } // 相同节点不用执行 if (broadcast_req->mysql_inst_id == ctc_instance_id) { ctc_log_note("ctc_invalidate_mysql_dd_cache curnode not need execute,mysql_inst_id:%u", broadcast_req->mysql_inst_id); @@ -618,6 +622,10 @@ static void ctc_init_mdl_request(ctc_lock_table_info *lock_info, MDL_request *md } int ctc_mdl_lock_thd(ctc_handler_t *tch, ctc_lock_table_info *lock_info, int *err_code) { + if (!is_work_flow()) { + ctc_log_system("[ctc_mdl_lock_thd]: mysqld is not started."); + return false; + } bool is_same_node = (tch->inst_id == ctc_instance_id); uint64_t mdl_thd_key = ctc_get_conn_key(tch->inst_id, tch->thd_id, true); @@ -754,6 +762,10 @@ void ctc_mdl_unlock_tables_thd(ctc_handler_t *tch, MDL_request *mdl_request) } void ctc_mdl_unlock_thd(ctc_handler_t *tch, ctc_lock_table_info *lock_info) { + if (!is_work_flow()) { + ctc_log_system("[ctc_mdl_unlock_thd]: mysqld is not started."); + return; + } bool is_same_node = (tch->inst_id == ctc_instance_id); uint64_t mdl_thd_key = ctc_get_conn_key(tch->inst_id, tch->thd_id, true); diff --git a/storage/ctc/ha_ctc.h b/storage/ctc/ha_ctc.h index e635898..839fd81 100644 --- a/storage/ctc/ha_ctc.h +++ b/storage/ctc/ha_ctc.h @@ -1094,6 +1094,7 @@ int alloc_str_mysql_mem(ctc_cbo_stats_t *cbo_stats, uint32_t part_num, TABLE *ta void free_columns_cbo_stats(ctc_cbo_stats_column_t *ctc_cbo_stats_columns, bool *is_str_first_addr, TABLE *table); int32_t ctc_get_shm_file_num(uint32_t *shm_file_num); int32_t ctc_get_shm_usage(uint32_t *ctc_shm_usage); +bool is_work_flow(); #pragma GCC visibility pop #endif \ No newline at end of file -- Gitee