-
Notifications
You must be signed in to change notification settings - Fork 289
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
DM: add checkpoint test for lightning-loader #3220
Conversation
Signed-off-by: Little-Wallace <[email protected]>
[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. |
err = l.core.RunOnce(taskCtx, cfg, nil) | ||
err = l.runLightning(ctx, cfg) | ||
if err == nil { | ||
err = lightning.CheckpointRemove(ctx, cfg, "all") |
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.
maybe we can keep the checkpoint in target db and clear it when user start-task with flag remove-meta
as syncer do
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.
+1. In the current dm implementation, we should delay clean checkpoint data when stop 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.
we at least should make sure IsFreshTask
returning false
after a successful loading, so it needs we don't remove lightning checkpoint or let IsFreshTask
inspecting LightningCheckpointList
9121b28
to
c5bc67a
Compare
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
/run-dm-integration-tests |
@@ -150,7 +180,8 @@ func (l *LightningLoader) restore(ctx context.Context) error { | |||
} | |||
cfg.Routes = l.cfg.RouteRules | |||
cfg.Checkpoint.Driver = lcfg.CheckpointDriverMySQL | |||
cfg.Checkpoint.Schema = config.TiDBLightningCheckpointPrefix + dbutil.ColumnName(l.workerName) | |||
cfg.Checkpoint.Schema = config.TiDBLightningCheckpointPrefix + dbutil.TableName(l.workerName, l.cfg.Name) |
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'm not sure why we need dbutil.TableName
, because in NewMySQLCheckpointsDB
of lightning it will do escaping for backquotes 🤔
can we only use config.TiDBLightningCheckpointPrefix + l.workerName + l.cfg.Name
as database name?
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.
It seems that can not pass test
cbc358c
to
d5cad3f
Compare
Signed-off-by: Little-Wallace <[email protected]>
ping @Little-Wallace |
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
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
I'll implement remove-meta
for lightning checkpoint in another PR
err = l.core.RunOnce(taskCtx, cfg, nil) | ||
err = l.runLightning(ctx, cfg) | ||
if err == nil { | ||
err = lightning.CheckpointRemove(ctx, cfg, "all") |
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 at least should make sure IsFreshTask
returning false
after a successful loading, so it needs we don't remove lightning checkpoint or let IsFreshTask
inspecting LightningCheckpointList
Signed-off-by: Little-Wallace <[email protected]>
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.
In future PR I'll check if we can use LightningCheckpointList
to implement IsFreshTask
, and implement --remove-meta
for lightning loader
/run-all-tests |
1 similar comment
/run-all-tests |
/run-all-tests |
1 similar comment
/run-all-tests |
20accf8
to
8bccbba
Compare
/run-all-tests |
"cluster" is the TLS name 🤔 |
/run-all-tests |
/run-dm-integration-test |
This pull request has been accepted and is ready to merge. Commit hash: 7c5fd31
|
/unhold |
/run-integration-test |
Codecov Report
@@ Coverage Diff @@
## master #3220 +/- ##
================================================
+ Coverage 56.5356% 57.8409% +1.3053%
================================================
Files 211 234 +23
Lines 22798 23983 +1185
================================================
+ Hits 12889 13872 +983
- Misses 8598 8711 +113
- Partials 1311 1400 +89 |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created: #3512. |
Signed-off-by: Little-Wallace [email protected]
What problem does this PR solve?
What is changed and how it works?
Add checkpoint test for lightning tidb-backend. I hope we can use tidb-backend to replace loader of dm.
Check List
Tests
Code changes
Side effects
Related changes
Release note