-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Table gone after concurrent EXCHANGE PARTITION #45920
Comments
The issue seems to be that the partitionID is set in the ddl client session (ddl_api.go) and then is used as the new tableID when applying the diff. This works for the first alter, but for the second alter, the given partitionID (same as the first one) is then used in applyCreateTable. So the second exchange partition will drop the the 't2' table, but when it will recreate it with the new tableID, it has already been swapped with 't', so it gets the first table instead of the partition/partitioned table, since it has already exchanged with the partition. So later when the second exchange partition tries to validate the rows it fails, since it cannot find any 't2' table (and information_schema.tables shows two 't' tables with the same table_id...). |
Since it is only gone from the table cache, a restart will make the table appear again... |
close pingcap#45791, close pingcap#45920 Signed-off-by: Yang Keao <[email protected]>
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
Failure with out the table removed
3. What did you see instead (Required)
Failure and table t2 no longer found.
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: