-
Notifications
You must be signed in to change notification settings - Fork 188
relay: start with the min binlog position in checkpoint #457
Conversation
Co-Authored-By: Xuecheng Zhang <csuzhangxc@gmail.com>
dm/master/coordinator/coordinator.go
Outdated
@@ -418,7 +425,7 @@ func (c *Coordinator) restartMysqlTask(w *Worker, cfg *config.MysqlConfig) bool | |||
Op: pb.WorkerOp_StartWorker, | |||
Config: task, | |||
} | |||
resp, err := w.OperateMysqlWorker(context.Background(), req, time.Second*3) | |||
resp, err := w.OperateMysqlWorker(context.Background(), req, time.Second*5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just add duration to let test pass, maybe @lichunzhu will fix it
this pr contain #451, we can merge 451 at the first, or review this pr directly and close 451 @lichunzhu @csuzhangxc |
@WangXiangUSTC I have already approved #451. If this PR runs fine in your machine, I think it's OK to merge it directly. |
/run-all-tests tidb=release-3.0 |
/run-all-tests tidb=release-3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
dm/master/coordinator/coordinator.go
Outdated
@@ -392,18 +392,26 @@ func (c *Coordinator) tryRestartMysqlTask() { | |||
for hasTaskToSchedule { | |||
select { | |||
case source := <-c.waitingTask: | |||
log.L().Info("try restart mysql task", zap.String("source", source)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the log try restart mysql task info is not accurate here. The tasks started for the first time are also scheduled in this function. Check c.waitingTask
in goland you will find the only read access is here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I update the log 70d6e8e
/run-all-tests tidb=release-3.0 |
/run-all-tests tidb=release-3.0 |
/run-all-tests tidb=release-3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@lichunzhu PTAL again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The unit test didn't pass. Could you pls check it? |
0023942
to
7802a15
Compare
/run-all-tests tidb=release-3.0 |
1 similar comment
/run-all-tests tidb=release-3.0 |
@lichunzhu I fix unit test in 7802a15 and 1f82f5a, PTAL again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
relay use the latest binlog position as default, if increment task migrate from
dm-worker1
todm-worker2
, sync unit will get binlog from checkpoint's binlog position, and this position <= the latest position, so sync unit can't get the binlog.What is changed and how it works?
get the min binlog position from all subtasks, and relay start with this min position.
Check List
Tests