-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syncer(dm): implement start-task --start-time #4485
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #4485 +/- ##
================================================
- Coverage 55.6402% 55.5116% -0.1287%
================================================
Files 494 506 +12
Lines 61283 62722 +1439
================================================
+ Hits 34098 34818 +720
- Misses 23750 24430 +680
- Partials 3435 3474 +39 |
/cc @D3Hunter |
/run-dm-integration-test |
if err != nil { | ||
return err | ||
if s.cfg.Meta == nil || s.cfg.Meta.BinLogName != binlog.FakeBinlogName { | ||
err = s.setInitActiveRelayLog(ctx) |
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.
seems setInitActiveRelayLog
can move to sync.Run so that we don't need this check s.cfg.Meta.BinLogName != binlog.FakeBinlogName
?
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.
when Init syncer, set active relay log info
we will risk the relay log being purged between Init and Run. I prefer we don't change old logic if we don't have enough thinking.
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.
but if we into this branch s.cfg.Meta.BinLogName != binlog.FakeBinlogName
user still have this risk
so how about make setInitActiveRelayLog
support set binlog user want to start in s.Init
? i mean call binlog finder
in init
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.
Init should not have long-running tasks by definition, it will cause whole pipeline timeout.
} | ||
err = cfg.Adjust() | ||
} else { | ||
err = cfg.Decode(task) | ||
} |
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.
Can we set inst.Meta after cfg.Decode? So we no need RawDecode and Adjust, only depend on cfg.Decode.
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.
cfg.Decode
will call adjust
internally, then it will report error about inst.Meta.
dm/syncer/checkpoint.go
Outdated
|
||
cp.logCtx.L().Info("delete all table checkpoint") | ||
_, err := cp.dbConn.ExecuteSQL( | ||
tctx, |
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.
Should we use maxDMLConnectionDuration or defaultDBTimeout?
zap.String("time", timeStr), | ||
zap.Stringer("pos", loc)) | ||
case binlog.BelowLowerBoundBinlogPos: | ||
s.tctx.L().Warn("fail to find binlog location by timestamp because the timestamp is too early, will use the earliest binlog location", |
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.
Will return error better?
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.
cc @sunzhaoyang
|
||
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ | ||
"stop-task test" \ | ||
"\"result\": true" 2 |
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.
How about triger a worker transfer event here?
if s.cliArgs != nil && s.cliArgs.StartTime != "" { | ||
clone := *s.cliArgs | ||
clone.StartTime = "" | ||
err2 := ha.PutTaskCliArgs(s.cli, s.cfg.Name, []string{s.cfg.SourceID}, clone) |
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.
Why not use DelTaskCliBySource?
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.
we might have more args in near future, so for compatible I should only remove the least argument.
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.
will review test later.
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.
will review test later
Co-authored-by: D3Hunter <jujj603@gmail.com>
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.
restLGTM
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
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
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 71a9cda
|
/run-verify |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 3ba5edd
|
/merge |
/run-verify |
/merge |
@lance6716: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #4106
What is changed and how it works?
continue on previous PRs, now syncer of DM worker should first find the corresponding binlog location of
--start-time
, clean outdated checkpoints and save it to global checkpoint. After the first time global checkpoint is flushed, DM worker also tries to clean the task command line arguments saved in etcd.Check List
Tests
Code changes
Side effects
Related changes
Release note