-
Notifications
You must be signed in to change notification settings - Fork 536
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): refactor emergency picker #15954
Conversation
src/meta/src/hummock/manager/mod.rs
Outdated
// 1. pull task from hummock_manager | ||
// 2. send task to compactor | ||
async fn pull_task_handler(hummock_manager: Arc<HummockManager>, pull_task_count: u32, group: u64, selector: &mut Box<dyn CompactionSelector>, task_type: TaskType, compactor: Arc<Compactor>) -> usize { | ||
let mut pick_task_count = 0; |
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.
Is it okay to recount pick_task_count
for each pull? If there are enough tasks, the count of picked tasks will be 2 times of the target.
src/meta/src/hummock/manager/mod.rs
Outdated
|
||
let pick_task_count = pull_task_handler(hummock_manager.clone(), pull_task_count, group, selector, task_type, compactor.clone()).await; | ||
// if the pick_task_count is less than `EXPECTED_PULL_TASK_RATIO`, try to pull the left tasks from emergency selector when write-stop | ||
const EXPECTED_PULL_TASK_RATIO: f32 = 0.75; |
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.
Same with the comment above. Will it be better to pass the pick_task_count: &mut usize
for limitation across pulls instead of limiting each pull to 75%?
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
1d6ef21
to
59b99bf
Compare
58a5c28
to
0f7dc65
Compare
let mut generated_task_count = 0; | ||
let mut existed_groups = groups.clone(); | ||
let mut no_task_groups: HashSet<CompactionGroupId> = HashSet::default(); | ||
let mut failed_tasks = vec![]; |
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.
nits: there are two patterns to mutate these variables
existed_groups
andno_task_groups
are mutabled insidehandle_pick_tasks
by passing&mut
generated_task_count
andfailed_tasks
are mutabled outside ofhandle_pick_tasks
by using the returned result.
Can we converge them to one pattern?
{ | ||
Some(config) => config.compaction_config.enable_emergency_picker, | ||
None => { | ||
unreachable!("compaction-group {} not exist", cg_id) |
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.
Is it really unreachable? Will compaction group be destroyed if the table in the cg is dropped?
…nto li0k/storage_refactor_emergency
…nto li0k/storage_refactor_emergency
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!
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_refactor_emergency
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
#15496 (comment)
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.