-
Notifications
You must be signed in to change notification settings - Fork 591
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(meta): do not split by vnode for low write throughput #12534
Conversation
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #12534 +/- ##
==========================================
- Coverage 67.99% 67.95% -0.05%
==========================================
Files 1535 1535
Lines 264830 264992 +162
==========================================
Hits 180080 180080
- Misses 84750 84912 +162
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
src/meta/src/hummock/compaction/picker/compaction_task_validator.rs
Outdated
Show resolved
Hide resolved
@@ -747,6 +773,10 @@ impl HummockLevelsExt for Levels { | |||
} | |||
delete_sst_ids_set.is_empty() | |||
} | |||
|
|||
fn can_partition_by_vnode(&self) -> bool { |
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.
Nothing to do with the current PR, in another PR I'm going to turn on partitioning in the default cg and the self.member_table_ids.len() == 1
will fail, any suggestions?
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.
Removed.
Signed-off-by: Little-Wallace <[email protected]>
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 haven't finished the review yet.
@@ -116,6 +118,7 @@ message HummockVersion { | |||
uint64 group_id = 3; | |||
uint64 parent_group_id = 4; | |||
repeated uint32 member_table_ids = 5; | |||
uint32 vnode_partition_count = 6; |
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.
Would you explain when this field is initialized / set?
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.
set in function build_initial_compaction_group_levels
.
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.
So for existing compaction groups, vnode_partition_count
is 0 and cannot be changed.
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.
🤔 Good catch.
I will refactor this code to avoid compatibility issues
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.
Will partition_vnode_count be mutable someday?
|
||
// Reduce the level num of l0 non-overlapping sub_level | ||
ctx.score_levels.push({ | ||
PickerInfo { | ||
if non_overlapping_size_score > SCORE_BASE { |
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.
Could you explain the idea behind non_overlapping_size_score > SCORE_BASE and non_overlapping_level_score > SCORE_BASE? Why ToBase is stricter about size_score, while Intra is stricter about level_score?
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.
because if there are not enough split-vnode file in level0, the selector will pick a large task to base level and it will case more write-amplification and also slowdown compaction
PTAL @hzxa21 |
There are several changes in main recently. I think we can rebase main and re-run the experiments to verify the results of this PR. |
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
Signed-off-by: Little-Wallace <[email protected]>
I run a benchmark test for nexmark q5,q7,q9,q10,q15,q16,q19,q20. It does not matter for performance |
Signed-off-by: Little-Wallace <[email protected]>
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
If a group does not write much data after split, we may generate too many small files in level-0. This PR will fix this case by control whether to cut sstable by vnode partition
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.