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

feat(storage): emergency picker for write_limit #12183

Merged
merged 16 commits into from
Sep 18, 2023

Conversation

Li0k
Copy link
Contributor

@Li0k Li0k commented Sep 8, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

This pr introduces a new emergency picker and enables it when the write limit is triggered. Simple logic to avoid live locking problems with write limits.

  1. Introduces a new emergency picker
  2. The new configuration determines whether or not the emergency picker is enable

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

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.

@Li0k Li0k marked this pull request as ready for review September 12, 2023 09:47
docker/Dockerfile Outdated Show resolved Hide resolved
@@ -887,7 +886,7 @@ impl HummockManager {
.sum::<usize>(),
start_time.elapsed()
);
} else if is_trivial_move && can_trivial_move {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it because all trivial move tasks are TaskType::Dynamic that we can remove this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we don't actually need to disable trivial-move, regardless of the type of task?

src/meta/src/hummock/manager/mod.rs Outdated Show resolved Hide resolved
@@ -616,6 +617,50 @@ pub fn default_level_selector() -> Box<dyn LevelSelector> {
Box::<DynamicLevelSelector>::default()
}

#[derive(Default)]
pub struct EmergencySelector {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move to an independent file, this file is enough large....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'm going to separate the implementation of the different selectors in a separate pr and put it in a independent file, like the picker

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@zwang28 zwang28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Please help to clarify whether removal of can_trivial_move is OK. @Little-Wallace

Copy link
Contributor

@Little-Wallace Little-Wallace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
But I still think it is not safety to select task without thinking of score of each level. I think this PR may bring some risk

@Li0k
Copy link
Contributor Author

Li0k commented Sep 18, 2023

LGTM. Please help to clarify whether removal of can_trivial_move is OK. @Little-Wallace

I will add it back

Copy link
Collaborator

@hzxa21 hzxa21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline: it is better to add a switch in risectl (maybe in compaction group config) control whether the emergency picker can be used.

@Li0k Li0k enabled auto-merge September 18, 2023 12:22
@Li0k Li0k changed the title feat(storage): new picker for write_limit feat(storage): emergency picker for write_limit Sep 18, 2023
@Li0k Li0k added this pull request to the merge queue Sep 18, 2023
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #12183 (79af0fe) into main (cc7e506) will decrease coverage by 0.03%.
The diff coverage is 15.38%.

@@            Coverage Diff             @@
##             main   #12183      +/-   ##
==========================================
- Coverage   69.79%   69.76%   -0.03%     
==========================================
  Files        1423     1424       +1     
  Lines      236196   236247      +51     
==========================================
- Hits       164859   164828      -31     
- Misses      71337    71419      +82     
Flag Coverage Δ
rust 69.76% <15.38%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/ctl/src/cmd_impl/hummock/compaction_group.rs 0.00% <0.00%> (ø)
src/ctl/src/lib.rs 0.00% <0.00%> (ø)
src/meta/src/hummock/compaction/level_selector.rs 94.00% <0.00%> (-4.04%) ⬇️
src/meta/src/hummock/compaction/mod.rs 86.56% <ø> (ø)
...k/compaction/picker/emergency_compaction_picker.rs 0.00% <0.00%> (ø)
...ta/src/hummock/manager/compaction_group_manager.rs 78.68% <0.00%> (-0.28%) ⬇️
src/meta/src/hummock/manager/mod.rs 60.36% <40.00%> (-0.16%) ⬇️
...ock/compaction/picker/compaction_task_validator.rs 88.39% <41.66%> (-4.79%) ⬇️
src/common/src/config.rs 85.71% <100.00%> (+0.08%) ⬆️
...c/meta/src/hummock/compaction/compaction_config.rs 68.13% <100.00%> (+0.35%) ⬆️
... and 2 more

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Merged via the queue into main with commit 4dadb7c Sep 18, 2023
12 of 13 checks passed
@Li0k Li0k deleted the li0k/storage_picker_for_write_limit branch September 18, 2023 13:07
@hzxa21 hzxa21 mentioned this pull request Oct 8, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants