-
Notifications
You must be signed in to change notification settings - Fork 594
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(storage): fix condition of compaction task validator #12473
Conversation
Codecov Report
@@ Coverage Diff @@
## main #12473 +/- ##
==========================================
- Coverage 69.42% 69.41% -0.02%
==========================================
Files 1429 1429
Lines 238628 238640 +12
==========================================
- Hits 165666 165642 -24
- Misses 72962 72998 +36
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…nto li0k/storage_fix_validator
…nto li0k/storage_fix_validator
std::cmp::min( | ||
self.config.max_bytes_for_level_base, | ||
std::cmp::max( | ||
(self.config.max_bytes_for_level_base as f64 * 1.2) as u64, |
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.
max_compaction_bytes/2
will be larger than self.config.max_bytes_for_level_base
. So this change makes no difference
input.total_file_count <= overlapping_max_compact_file_numer | ||
} | ||
}; | ||
let waiting_enough_files = input.select_input_size < max_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.
This line can be merge with line 117
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.
rest LGTM
…nto li0k/storage_fix_validator
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
When the number of files or levels in a compact task is too large, no other limitations are considered. Data flow on lsm will be smoother.
Otherwise, with some small ssts, it may not be possible to select a sufficient sst size to guarantee to base compaction execution. (The strategy is to ensure that the number of files selected does not exceed the limit, and at the same time the size is larger than the target.)After the move state table, the sub level is directly inserted into the new cg. Thereafter, the base compaction picker selects a task that does not satisfy the select_level_size > base_level target level size limit based on the max_size limit (write-amp).
The reason for this is that the max_size of the picker is exactly equal to the max_base_level_size, and the size of the selected task will be smaller than the max_base_level_size, so it will not be able to satisfy the write-amp limit. This pr fixes this problem.
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.