-
Notifications
You must be signed in to change notification settings - Fork 206
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
fix: compaction support pick by max_seq #1041
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jiacai2050
changed the title
add pick by seq
fix: size tired compaction support pick by max_seq
Jun 29, 2023
jiacai2050
changed the title
fix: size tired compaction support pick by max_seq
WIP fix: size tired compaction support pick by max_seq
Jun 29, 2023
jiacai2050
force-pushed
the
feat-compact-by-seq
branch
2 times, most recently
from
July 3, 2023 03:02
bed176a
to
6f47274
Compare
jiacai2050
force-pushed
the
feat-compact-by-seq
branch
from
July 3, 2023 03:04
6f47274
to
54c9175
Compare
jiacai2050
changed the title
WIP fix: size tired compaction support pick by max_seq
fix: size tired compaction support pick by max_seq
Jul 3, 2023
jiacai2050
force-pushed
the
feat-compact-by-seq
branch
from
July 3, 2023 07:09
fae4492
to
c9f1a9c
Compare
jiacai2050
force-pushed
the
feat-compact-by-seq
branch
from
July 3, 2023 07:31
c9f1a9c
to
bddc27d
Compare
jiacai2050
changed the title
fix: size tired compaction support pick by max_seq
fix: compaction support pick by max_seq
Jul 3, 2023
Rachelint
reviewed
Jul 4, 2023
Rachelint
approved these changes
Jul 5, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
Part of #987.
Current implementation will compact by file size, max_seq is not considered, this may cause data corruption
in corner case, eg:
If compact pick sst1 and sst3, and output sst4, its max_seq will be 12, now PK1 exists in two files:
That's to say, PK1's value is 10 now, which is wrong value(9 is right).
Detailed Changes
When do compaction, first sort sst by max_seq desc, then only pick adjacent ssts, the original issue is fixed in this way.
At the same time picked ssts are ensured to meet other requirements such as
min_threshold
,max_threshold
,max_input_size
.Test Plan
UT and manually.