on owner change, when DDL with higher schema version commits before a DDL with lower schema version, MDL fails to update version for it #58483
Labels
component/ddl
This issue is related to DDL of TiDB.
severity/moderate
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
this case only happens on owner change, as there can only be 1 schema version update in progress at the same time.
we use create-table as a example, timeline for the case:
create table aaa
J1, after alloc schema version X, but before it commit the txn with diff, owner change to Bcreate table bbb
J2 first as we run jobs without dependency concurrently, so it alloc schema versionX+1
, and commit the txn with diffX+1
, and they all setjobNeedToSync=false
tidb/pkg/domain/domain.go
Lines 1098 to 1100 in 042a332
done
tidb/pkg/ddl/create_table.go
Lines 98 to 101 in 042a332
running
, because:running
in heretidb/pkg/ddl/job_worker.go
Line 824 in 042a332
tidb/pkg/ddl/create_table.go
Lines 98 to 101 in 042a332
runJobErr
is saved, and retried later, in this case the job never ends until it used upddl-error-count-limit
, it's another issue,tidb/pkg/ddl/job_worker.go
Lines 589 to 600 in 042a332
running
, but found that it has un-synced schema version change in heretidb/pkg/ddl/job_scheduler.go
Lines 565 to 569 in 042a332
X+1
, so MDL check loop keeps continue in heretidb/pkg/domain/domain.go
Lines 1063 to 1070 in 042a332
it also introduced another bug #58486 that even through all node have synced to
X+1
, they all thinkX
is a hole and skip it, so no one knowsaaa
is created even we fix all above issues.2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: