-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Restore: implement restorer for compacted SST/Snapshot/log files #57208
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
Hi @3pointer. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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 kubernetes-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #57208 +/- ##
================================================
+ Coverage 72.8440% 74.6611% +1.8171%
================================================
Files 1672 1721 +49
Lines 462716 473037 +10321
================================================
+ Hits 337061 353175 +16114
+ Misses 104867 97686 -7181
- Partials 20788 22176 +1388
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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
} | ||
if len(sstOutputs) != len(subCompaction.SstOutputs) { | ||
log.Info("partial files in sub compaction skipped due to checkpoint") | ||
subCompaction.SstOutputs = sstOutputs |
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 is a little strange that a predicate function modifies its argument. Would you add some comments in the interface?
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.
This is because the subCompaction
is not a basic restore unit during restore, the restore unit is file. and subCompaction
might contains multiple files. sometimes we may need to skip partial files in one subCompaction
.
// Skip the file by checkpoints or invalid files | ||
ShouldSkip(T) bool | ||
// GetAccumulations returns an iterator for the accumulated values. | ||
GetAccumulations() *SplitHelperIterator |
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 is a little strange that Accumulate
receives T
but GetAccumulations
returns Valued
? It seems this method actually returns the keys to be splitted.
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.
Yes, I want to refactor SplitHelperIterator
too, but I suggest doing this in future PR.
Close() error | ||
} | ||
|
||
type FileImporter interface { |
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 FileImporter
is almost the same as SstRestorer
. Would you merge them or add some comments that explains why we need two?
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.
ok, add some comments, PTAL
return f[:idx] | ||
} | ||
|
||
type PipelineRestorerWrapper[T any] struct { |
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.
Perhaps this can be a plain function. So the type argument can be deduced, no explicit annotations like restore.PipelineRestorerWrapper[*logclient.LogDataFileInfo]
needed.
/test unit-test |
@3pointer: The specified target(s) for
The following commands are available to trigger optional jobs:
Use
In response to this:
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 kubernetes/test-infra repository. |
/test pull-lightning-integration-test |
@3pointer: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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 kubernetes-sigs/prow repository. |
@3pointer: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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 kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Leavrth, YuJuncen The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
What problem does this PR solve?
Issue Number: close #57209
Problem Summary:
This pull request introduces a unified structure for managing compacted SST, Snapshot, and log files. Previously, these file types were handled independently, leading to redundant code and potential inconsistencies. The new common struct simplifies file management, improves code maintainability, and reduces the likelihood of errors.
What changed and how does it work?
Impact: This update significantly streamlines the restoration process, reducing complexity and improving performance by adopting a unified handling approach. Components across the system have been updated to leverage the new struct, fostering consistency and reducing maintenance overhead.
NOTE: This PR doesn't consider the
checkpoint
logic for compacted log files. I'll do it in another PR.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.