-
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
Parallel truncate table & add index possible race condition #3876
Comments
I think I am having the same problem. When I have several parallel containers in kubernetes that try to truncate a table. It seems to cause some kind of race which causes that error.
|
@breeswish @Kansuler In TiDB, DDL jobs will run in sequence one by one. So in this case, truncate table will be converted into two jobs, one is drop table, another one is create table with the same name and schema. So if the sequence is DropTable, AlterTable, CreateTable, then the AlterTable will found not table with that name. |
When SQL above are executed in parallel, sometimes
ADD INDEX
will fail with error:Besides, when failing with errors,
ADD INDEX
also costs notable time (normal: <0.2s, error: ~4s)TiDB log:
The text was updated successfully, but these errors were encountered: