-
Notifications
You must be signed in to change notification settings - Fork 590
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
feat(storage): adjust base compaction limitation #17979
Conversation
…nto li0k/storage_adjust_base_compaction
…nto li0k/storage_adjust_base_compaction
@@ -406,7 +406,7 @@ impl NonOverlapSubLevelPicker { | |||
|
|||
let ret = self.pick_sub_level(l0, level_handler, sst); | |||
if ret.sstable_infos.len() < self.min_expected_level_count | |||
&& ret.total_file_size < self.min_compaction_bytes | |||
|| ret.total_file_size < self.min_compaction_bytes |
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.
I guess the motivation to change &&
to ||
here is that we choose to rely on L0 intra compaction to reduce the level count when ret.sstable_infos.len() >= self.min_expected_level_count
so that we can ensure that to base compaction must contain at least self.min_expected_level_count
and at least self.min_compaction_bytes
. Let's document this in the codes.
Consider a scenario
|
…nto li0k/storage_adjust_base_compaction
…nto li0k/storage_adjust_base_compaction
…nto li0k/storage_adjust_base_compaction
…nto li0k/storage_adjust_base_compaction
…nto li0k/storage_adjust_base_compaction
src/meta/src/hummock/compaction/picker/min_overlap_compaction_picker.rs
Outdated
Show resolved
Hide resolved
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
…nto li0k/storage_adjust_base_compaction
…nto li0k/storage_adjust_base_compaction
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
In some scenarios, I found that CN generates small ssts, some ssts will be trivial-moved to base level, and the small files may destroy the efficiency of base level compaction, I want to adjust the strategy to reject some trivial-move and base level compaction tasks for some small ssts, so as to achieve better batching and reduce the small sst.
Notes: however, that this PR is not intended to significantly increase compaction capacity, but rather is a safeguard to minimise the number of small files compacting to the base level.
This PR changed:
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.