-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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 unexpected compaction error for compact files #8024
Conversation
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@ajkr Is there anyone can take a look and merge the PR? Thanks. CI failure looks irrelevant. |
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.
@ajkr has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
Agreed the check is incorrect and can be removed.
num_input_levels == output_level - start_level + 1
My reading of the code suggests this is still true today. Is it not? That condition can be true and the check can still be incorrect since that condition doesn't imply anything about whether the input levels are empty.
The issue is not about level compaction, but about when we issue |
@ajkr the test fails but seems unrelated. Could you help to take a look? |
|
I thought the below code fills in entries for all the levels not explicitly provided, which would be L1-L4 in your example. rocksdb/db/compaction/compaction_picker.cc Lines 407 to 411 in 08144bc
Anyways, this isn't a blocking issue - I am just waiting on somebody to accept the internal PR to land it. |
Oh, I see. |
@Connor1996 has updated the pull request. You must reimport the pull request before landing. |
@ajkr has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary:
When doing CompactFiles on the files of multiple levels(num_level > 2) with L0 is included, the compaction would fail like this.
The reason is that in
VerifyCompactionFileConsistency
it checks the levels between the L0 and base level should be empty, but it regards the compaction triggered byCompactFiles
as an L0 -> base level compaction wrongly.The condition is committed several years ago, whereas it isn't correct anymore.
So this PR just deletes the incorrect check.
Test Plan:
make check