Skip to content
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 error for compact files #228

Merged
merged 2 commits into from
Mar 8, 2021

Conversation

Connor1996
Copy link
Member

cherry-pick of facebook#8024

Summary:
When doing CompactFiles on the files of multiple levels(num_level > 2) with L0 is included, the compaction would fail like this.
image

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 by CompactFiles as an L0 -> base level compaction wrongly.

The condition is committed several years ago, considering num_input_levels == output_level - start_level + 1 at that time, whereas it not correct anymore.

if (vstorage->compaction_style_ == kCompactionStyleLevel &&
c->start_level() == 0 && c->num_input_levels() > 2U)
So this PR just deletes the incorrect check.

Test Plan:
make check

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@Connor1996 Connor1996 requested review from tabokie and yiwu-arbug March 5, 2021 09:22
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@Connor1996 Connor1996 merged commit afa47b6 into tikv:6.4.tikv Mar 8, 2021
Connor1996 added a commit to Connor1996/rocksdb that referenced this pull request Mar 8, 2021
* fix compaction error for compact files

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Connor1996 added a commit that referenced this pull request Mar 10, 2021
* fix compaction error for compact files

Signed-off-by: Connor1996 <zbk602423539@gmail.com>
@tabokie tabokie mentioned this pull request May 9, 2022
39 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants