pingcap / tidb-binlog

A tool used to collect and merge tidb's binlog for real-time data backup and synchronization.
Apache License 2.0
292 stars 130 forks source link

bilateral synchronization: Write conflict could happen in update mark table #1022

Open 3pointer opened 3 years ago

3pointer commented 3 years ago

Bug Report

  1. What did you do? If possible, provide a recipe for reproducing the error. enable bilateral synchronization with two TiDB cluster.

  2. What did you expect to see? update mark table without conflict.

  3. What did you see instead? write conflict in TiDB log.

  4. Please provide the relate downstream type and version of drainer. (run drainer -V in terminal to get drainer's version) v4.0.2

3pointer commented 3 years ago

we have workercount number of goroutine to singleExecRetry dmls. and each worker will get one certain id from addIndex, this usually works fine.

the problem is here, we might split dmls again in some worker. this could make write conflict due to some worker may get same id by addIndex.

I think the solution is we should bind the worker with id, no matter how much dmls it have.