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

fix(storage): fix compactor task parallelism race #16387

Merged
merged 15 commits into from
May 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(compactor): address comments
  • Loading branch information
Li0k committed May 14, 2024
commit 9f4b393406032f03bc3d74ce9a311413236ea9d7
6 changes: 3 additions & 3 deletions src/storage/src/hummock/compactor/mod.rs
Original file line number Diff line number Diff line change
@@ -513,8 +513,9 @@ pub fn start_compactor(
continue 'start_stream;
}

running_task_parallelism
.fetch_add(parallelism as u32, Ordering::SeqCst);
executor.spawn(async move {
running_task_parallelism.fetch_add(parallelism as u32, Ordering::SeqCst);
let (tx, rx) = tokio::sync::oneshot::channel();
let task_id = compact_task.task_id;
shutdown.lock().unwrap().insert(task_id, tx);
@@ -563,8 +564,7 @@ pub fn start_compactor(

let enable_check_compaction_result =
context.storage_opts.check_compaction_result;
let need_check_task = !compact_task.sorted_output_ssts.is_empty()
&& compact_task.task_status() == TaskStatus::Success;
let need_check_task = !compact_task.sorted_output_ssts.is_empty() && compact_task.task_status() == TaskStatus::Success;

if enable_check_compaction_result && need_check_task {
match check_compaction_result(&compact_task, context.clone())