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

CompactRange avoid double-compacting data in bottom level #4995

Closed
ajkr opened this issue Feb 15, 2019 · 3 comments
Closed

CompactRange avoid double-compacting data in bottom level #4995

ajkr opened this issue Feb 15, 2019 · 3 comments
Assignees
Labels

Comments

@ajkr
Copy link
Contributor

ajkr commented Feb 15, 2019

Depending on the config, CompactRange does following compactions:
L0->L1
L1->L2
...
Ln-1 -> Ln
Ln -> Ln
The final Ln -> Ln compaction is partly unnecessary as it recompacts all the files that were just generated by the Ln-1 -> Ln. We should avoid recompacting such files. That rule should be applied to Lmax only.

@miasantreble
Copy link
Contributor

miasantreble commented Mar 14, 2019

@ajkr trying to understand the problem better, is the goal to skip bottom level compaction totally or to skip files that were newly created from level Ln-1 as part of the current compaction?

@ajkr
Copy link
Contributor Author

ajkr commented Mar 14, 2019

The latter. The Ln->Ln compactions currently take all files in Ln as input. However, some of those files were recently created by an Ln-1->Ln compaction as part of the same manual compaction. For those files we just created in Ln, there should be no need to put them through any more compactions.

@ajkr
Copy link
Contributor Author

ajkr commented Mar 14, 2019

I think Yoshi had some important insights into this in the internal task.

@miasantreble miasantreble self-assigned this Mar 15, 2019
facebook-github-bot pushed a commit that referenced this issue Apr 17, 2019
…5138)

Summary:
Depending on the config, manual compaction (leveled compaction style) does following compactions:
L0->L1
L1->L2
...
Ln-1 -> Ln
Ln -> Ln
The final Ln -> Ln compaction is partly unnecessary as it recompacts all the files that were just generated by the Ln-1 -> Ln. We should avoid recompacting such files. This rule should be applied to Lmax only.
Resolves issue #4995
Pull Request resolved: #5138

Differential Revision: D14940106

Pulled By: miasantreble

fbshipit-source-id: 8d3cf5507a17e76f3333cfd4bac5256d005636e5
vagogte pushed a commit to vagogte/rocksdb that referenced this issue Jun 18, 2019
…acebook#5138)

Summary:
Depending on the config, manual compaction (leveled compaction style) does following compactions:
L0->L1
L1->L2
...
Ln-1 -> Ln
Ln -> Ln
The final Ln -> Ln compaction is partly unnecessary as it recompacts all the files that were just generated by the Ln-1 -> Ln. We should avoid recompacting such files. This rule should be applied to Lmax only.
Resolves issue facebook#4995
Pull Request resolved: facebook#5138

Differential Revision: D14940106

Pulled By: miasantreble

fbshipit-source-id: 8d3cf5507a17e76f3333cfd4bac5256d005636e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants