Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix drop_table_by_id fail when TableIdToName cannot found #14002

Merged
merged 3 commits into from
Dec 14, 2023
Merged

chore: fix drop_table_by_id fail when TableIdToName cannot found #14002

merged 3 commits into from
Dec 14, 2023

Conversation

lichuang
Copy link
Contributor

@lichuang lichuang commented Dec 13, 2023

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

chore: fix drop_table_by_id fail when TableIdToName cannot found

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

This change is Reviewable

@lichuang lichuang requested a review from drmingdrmer December 13, 2023 08:58
@github-actions github-actions bot added the pr-chore this PR only has small changes that no need to record, like coding styles. label Dec 13, 2023
Copy link
Member

@drmingdrmer drmingdrmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 10 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: 3 of 10 files reviewed, 3 unresolved discussions (waiting on @lichuang)


src/meta/api/src/schema_api_impl.rs line 2362 at r3 (raw file):

            let db_id = dbid_tbname.db_id;
            let tbname = dbid_tbname.table_name.clone();

It looks like tbname is only used for building an error. Therefore there is no need to pass in a table_name in req. And in this scenario, the error could be UnknownTableId instead of an UnknownTable. Because when the table can not be found by (db_id, table_name), the only possible reason is that the table is remove by other transaction.

This way we do not need to be bother using table_name in req.

What say you?

@BohuTANG BohuTANG merged commit f12f3f2 into databendlabs:main Dec 14, 2023
68 of 69 checks passed
@lichuang lichuang deleted the fix_drop_table_by_id_fail branch December 19, 2023 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-chore this PR only has small changes that no need to record, like coding styles.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: fix drop_table_by_id when TableIdToName cannot found
3 participants