Skip to content

Commit

Permalink
chore: log more info for debug when tables with same name found (apac…
Browse files Browse the repository at this point in the history
…he#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.
  • Loading branch information
Rachelint authored Jun 11, 2024
1 parent 0970b03 commit a1869dc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/analytic_engine/src/table/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a1869dc

Please sign in to comment.