From 82adba68c861ff5a48a37cf7242d1073b5257a24 Mon Sep 17 00:00:00 2001 From: Li0k Date: Wed, 22 May 2024 18:11:47 +0800 Subject: [PATCH] fix(compactor): fix the calculation of pending_pull_task_count (#16885) --- src/storage/src/hummock/compactor/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage/src/hummock/compactor/mod.rs b/src/storage/src/hummock/compactor/mod.rs index be9a3ffad0385..60d35d9a877c4 100644 --- a/src/storage/src/hummock/compactor/mod.rs +++ b/src/storage/src/hummock/compactor/mod.rs @@ -393,7 +393,7 @@ pub fn start_compactor( let mut pending_pull_task_count = 0; if pull_task_ack { // TODO: Compute parallelism on meta side - pending_pull_task_count = (max_task_parallelism - running_task_parallelism.load(Ordering::SeqCst)).max(max_pull_task_count); + pending_pull_task_count = (max_task_parallelism - running_task_parallelism.load(Ordering::SeqCst)).min(max_pull_task_count); if pending_pull_task_count > 0 { if let Err(e) = request_sender.send(SubscribeCompactionEventRequest {