From a1869dc670c7ca2a103063c60c6585f1780e5622 Mon Sep 17 00:00:00 2001 From: kamille Date: Tue, 11 Jun 2024 09:58:19 +0800 Subject: [PATCH] chore: log more info for debug when tables with same name found (#1537) ## Rationale We just panic but log nothing when found two tables with the same table name, it turns debugging into a disaster... ## Detailed Changes Log the needed table infos when found two tables with the same table name before panic. ## Test Plan Test maually. --- src/analytic_engine/src/table/data.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/analytic_engine/src/table/data.rs b/src/analytic_engine/src/table/data.rs index 2982454d5a..c9ba1662db 100644 --- a/src/analytic_engine/src/table/data.rs +++ b/src/analytic_engine/src/table/data.rs @@ -796,6 +796,15 @@ impl TableDataSet { pub fn insert_if_absent(&mut self, table_data_ref: TableDataRef) -> bool { let table_name = &table_data_ref.name; if self.table_datas.contains_key(table_name) { + let exist_table = self.table_datas.get(table_name).unwrap(); + logger::error!( + "found duplicated table_name:{}, exist_table_id:{}, exist_table_shard_id:{}, inserted_table_id:{}, inserted_table_shard_id:{}", + table_name, + exist_table.id, + exist_table.shard_info.shard_id, + table_data_ref.id, + table_data_ref.shard_info.shard_id, + ); return false; } self.table_datas