starrocks
starrocks copied to clipboard
[Enhancement] Support size-tiered compaction for pk
Why I'm doing:
This PR supports size-tiered compaction for primary key table to reduce the IO amplification of compaction
What I'm doing:
- Add config enable_pk_size_tiered_compaction_strategy to control new policy.
- When pick rowsets to do compaction, we separate rowsets into different rowset levels by data size. And merge the rowsets in the same level to reduce IO amplification.
Test
Test Steps:
- Initial import of a large rowset.
- Import a rowset of 1/1000 size every 1 second, continuously importing 1000 versions.
- Calculate the total write volume of compaction.
- Without Size Tiered Compaction Policy
Ingestion size | total write size | Write amplification | |
---|---|---|---|
1G + insert + 1/1000 | 747278172 | 7846420807 | 10.5 |
1G + upsert + 1/1000 | 747278172 | 9465076121 | 12.6 |
- With Size Tiered Compaction Policy
Ingestion size | total write size | Write amplification | |
---|---|---|---|
1G + insert + 1/1000 | 747278172 | 1846699622 | 2.47 |
1G + upsert + 1/1000 | 747278172 | 1952721141 | 2.61 |
What type of PR is this:
- [ ] BugFix
- [ ] Feature
- [x] Enhancement
- [ ] Refactor
- [ ] UT
- [ ] Doc
- [ ] Tool
Does this PR entail a change in behavior?
- [x] Yes, this PR will result in a change in behavior.
- [ ] No, this PR will not result in a change in behavior.
If yes, please specify the type of change:
- [ ] Interface/UI changes: syntax, type conversion, expression evaluation, display information
- [ ] Parameter changes: default values, similar parameters but with different default values
- [x] Policy changes: use new policy to replace old one, functionality automatically enabled
- [ ] Feature removed
- [ ] Miscellaneous: upgrade & downgrade compatibility, etc.
Checklist:
- [x] I have added test cases for my bug fix or my new feature
- [ ] This pr needs user documentation (for new or modified features or behaviors)
- [ ] I have added documentation for my new feature or new function
- [ ] This is a backport pr
Bugfix cherry-pick branch check:
- [x] I have checked the version labels which the pr will be auto-backported to the target branch
- [x] 3.2
- [x] 3.1
- [ ] 3.0
- [ ] 2.5
[FE Incremental Coverage Report]
:white_check_mark: pass : 0 / 0 (0%)
[BE Incremental Coverage Report]
:white_check_mark: pass : 129 / 144 (89.58%)
file detail
path | covered_line | new_line | coverage | not_covered_line_detail | |
---|---|---|---|---|---|
:large_blue_circle: | be/src/storage/tablet_updates.cpp | 129 | 144 | 89.58% | [2643, 2644, 2648, 2655, 2656, 2657, 2674, 2675, 2676, 2677, 2767, 2770, 2801, 2802, 3112] |
@Mergifyio backport branch-3.2
@Mergifyio backport branch-3.1
backport branch-3.2
✅ Backports have been created
-
#42272 [Enhancement] Support size-tiered compaction for pk (backport #41130) has been created for branch
branch-3.2
backport branch-3.1
✅ Backports have been created
-
#42273 [Enhancement] Support size-tiered compaction for pk (backport #41130) has been created for branch
branch-3.1
but encountered conflicts