-
Notifications
You must be signed in to change notification settings - Fork 287
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
loader(dm): simplify lightning checkpoint and add clean meta #3813
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. |
/run-dm-integration-test |
/run-dm-integration-test |
/run-dm-integration-test |
/run-dm-integration-test |
/run-dm-integration-test |
/run-verify |
|
||
const ( | ||
lightningStatusInit lightingLoadStatus = iota | ||
lightningStatusRunning |
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 reuse CheckpointStatus
in tidb/pkg/checkpoints
?
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.
do you mean the real tidb-lightning's CheckpointStatus
? I think because there are so many state in it, it maybe hard to understand of not familiar with tidb-lightning
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.
oh my fault i got the two status mixed up, now i think the current implementaion make more sense
btw, how about direct use char like init
,running
, finished
in db? maybe this can increase readability
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.
done
|
||
const ( | ||
lightningStatusInit lightingLoadStatus = iota | ||
lightningStatusRunning |
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.
oh my fault i got the two status mixed up, now i think the current implementaion make more sense
btw, how about direct use char like init
,running
, finished
in db? maybe this can increase readability
dm/loader/checkpoint.go
Outdated
return lightningStatusInit, nil | ||
} | ||
|
||
func (cp *LightningCheckpointList) RemoveTaskCheckPoint(ctx context.Context) error { |
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 is this function to be called ?
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.
No used now. It is orginally designed for being calling at cleanup meta, but the current design just call raw drop table
like other tables. 😅
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.
so we can delete this func?
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
dm/loader/checkpoint.go
Outdated
return lightningStatusInit, nil | ||
} | ||
|
||
func (cp *LightningCheckpointList) RemoveTaskCheckPoint(ctx context.Context) error { |
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.
so we can delete this func?
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 lightning's pb checkpoint be removed when we remove-meta
? Or maybe left a comment?
We don't have a task contains only load+sync, but I'm not sure whether we will have this kind of task in the future or not.
The checkpoint is under dump directory, so it can be cleaned up when dump data is cleaned. |
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #3813 +/- ##
================================================
- Coverage 57.0741% 55.3098% -1.7644%
================================================
Files 478 484 +6
Lines 56551 59060 +2509
================================================
+ Hits 32276 32666 +390
- Misses 20978 23090 +2112
- Partials 3297 3304 +7 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 5c489fd
|
@glorv: 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. |
/run-kafka-integration-test /tidb=pr/30773 |
What problem does this PR solve?
start-task --remove-meta
, https://github.com/pingcap/ticdc/issues/3510Close #3509
What is changed and how it works?
mysql
tofile
and stop the file checkpoint at dump dirlightning_checkpoint_list
table in downstream for (task-name, worker-name) to (task-name, source-name, status). Lightning depend this table to check its load status (fresh, loading, finished).Check List
Tests
Code changes
Side effects
Related changes
Release note