write conflict when create index on partition table #22708
Labels
component/tablepartition
This issue is related to Table Partition of TiDB.
severity/moderate
sig/sql-infra
SIG: SQL Infra
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)
2. What did you expect to see? (Required)
No error in tidb.log
3. What did you see instead (Required)
[ERROR] [ddl_worker.go:158] ["[ddl] handle DDL job failed"] [worker="worker 4, tp add index"] [error="[kv:9007]Write conflict, txnStartTS=422642994193104901, conflictStartTS=422642995477610509, conflictCommitTS=422642995477610510, key={metaKey=true, key=DDLJobReorg, field=\u0000\u0000\u0000\u0000\u0000\u0000\ufffdf} primary=[]byte{0x6d, 0x44, 0x44, 0x4c, 0x4a, 0x6f, 0x62, 0x41, 0x64, 0xff, 0x64, 0x49, 0x64, 0x78, 0x4c, 0x69, 0x73, 0x74, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6c, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} [try again later]"]
Analyze:
In addTableIndex:
updateReorgInfo would call UpdateDDLReorgHandle() and write the meta key
mDDLJobReorgKey
Meanwhile, the background goroutine runReorgJob() would call UpdateDDLReorgStartHandle() and write the meta key
mDDLJobReorgKey
.So there will be a write conflict on the meta key.
4. What is your TiDB version? (Required)
4.0.9, 5.0.0 rc
The text was updated successfully, but these errors were encountered: