-
Notifications
You must be signed in to change notification settings - Fork 188
stop/pause until reached the end of a transaction #1095
Comments
another way is reverting to last consistent point (maybe recorded in checkpoint) if TiDB could flashback table |
Maybe we can refer to tidb-binlog's logic:
https://github.com/pingcap/tidb-binlog/blob/v4.0.13/drainer/syncer.go#L484 |
How about saving to the end of the transaction(last xid event) directly every time |
Since this cannot guarantee the consistency of upstream and downstream data, we choose to delay syncer when stop/pause until the end of the transaction, and then |
Initial idea: Delay when syncer exits and job closes. Line 3040 in 11fb5a8
Steps:
waitXIDType: type waitXIDType int
const (
noWait waitXIDType = iota
waiting
waitComplete
) PTAL @lance6716 @lichunzhu |
there're so many states of syncer: normal replication, sharing re-sync, handle-error injected some SQL, check whether to turn off safe mode, and your waiting xid. could you use a more clear way to express above states and their transition? maybe a state machine |
I'm afraid I can't fully understand all the above states in a short time |
Feature Request
Is your feature request related to a problem? Please describe:
DM split transactions from upstream MySQL into rows and re-aggregate rows into a new transaction as a batch.
When
stop-task
orpause-task
, maybe only a part of rows in an upstream MySQL transaction have been committed into the downstream TiDB, in other words, the original transaction is broken in TiDB after that.Describe the feature you'd like:
stop/pause the task until reached the end of a transaction for
start-task
/pause-task
or shutdown the DM-worker process normally.Describe alternatives you've considered:
Teachability, Documentation, Adoption, Migration Strategy:
The text was updated successfully, but these errors were encountered: