-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
lightning: skip restore table when source files are empty #28189
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. |
There are at least four special judgments(include this PR) for empty source table 😂, can we unify them in one place? |
/run-all-tests |
/run-integration-br-tests |
@@ -1349,6 +1349,9 @@ func (rc *Controller) restoreTables(ctx context.Context) error { | |||
if err != nil { | |||
return errors.Trace(err) | |||
} | |||
if cp.Status < checkpoints.CheckpointStatusAllWritten && len(tableMeta.DataFiles) == 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.
Why cp.Status < checkpoints.CheckpointStatusAllWritten
is needed 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.
If cp.Status >= CheckpointStatusAllWritten
then the restore process has no relation with the source files anymore, so we may allow it to continue even if we find there are no source files. Maybe there are situations that the source files are corrupted, the import phase can still go on.😅
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.
Comparing statue is wired. Status is not a clear name, Rename it to stage or something similar would be more clear.
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. But I think we shall not decide checksum and meta-table in one condition code.
I thought about this, but it's not easy to do so. In theory the management of metadata should be decouple, but because only after checksum can we know whether the metadata can be cleaned up. Another option is to always do check and cleanup on demand after restore table, but this kind of approach can't take advantage of the information after checksum. Not sure if we need to move this cleanup logic after restore table, the logic will be more complex than the current implement. |
/hold |
/run-integration-br-test |
the new test failed.
|
/run-integration-br-test |
Fixed. Since we don't support incremental restore for importer backend, I just from the case for |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: d4e8eef
|
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.2 in PR #32388 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.3 in PR #32389 |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-5.4 in PR #32390 |
What problem does this PR solve?
Issue Number: close #28144
Problem Summary:
What is changed and how it works?
Skip restore table when there are no source files.
Check List
Tests
Side effects
Documentation
Release note