{"record":{"id":"0deb8af212eff324","repo":"risingwavelabs/risingwave","slug":"trigger-manual-compaction-no-compaction-task-is-av","errorCode":null,"errorMessage":"trigger_manual_compaction No compaction_task is available. compaction_group {}","messagePattern":"trigger_manual_compaction No compaction_task is available\\. compaction_group (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/meta/src/hummock/manager/compaction/mod.rs","lineNumber":1123,"sourceCode":"                    return Err(err);\n                }\n\n                return Err(anyhow::anyhow!(err)\n                    .context(format!(\n                        \"Failed to get compaction task for compaction_group {}\",\n                        compaction_group,\n                    ))\n                    .into());\n            }\n        };\n        let compact_task = match compact_task {\n            Some(compact_task) => compact_task,\n            None => {\n                if exclusive && blocked_by_pending {\n                    return Ok(ManualCompactionTriggerResult::Retry);\n                }\n                // No compaction task available.\n                return Err(anyhow::anyhow!(\n                    \"trigger_manual_compaction No compaction_task is available. compaction_group {}\",\n                    compaction_group\n                )\n                .into());\n            }\n        };\n\n        // 3. send task to compactor\n        let task_id = compact_task.task_id;\n        let compact_task_string = compact_task_to_string(&compact_task);\n        tracing::info!(\n            compact_task_string,\n            duration = ?start_time.elapsed(),\n            \"Triggered manual compaction task.\"\n        );\n\n        let report_rx = self.register_compaction_task_report_waiter(task_id);\n        if let Err(err) = compactor","sourceCodeStart":1105,"sourceCodeEnd":1141,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/hummock/manager/compaction/mod.rs#L1105-L1141","documentation":"The compaction task selector returned no task for the requested compaction group, so manual compaction cannot proceed. If the request was exclusive and a pending (not yet committed) compaction blocks progress, the manager returns Ok(Retry) instead of this error; this error is only raised when there is genuinely nothing to compact or no eligible task.","triggerScenarios":"Calling trigger_manual_compaction when the selector picks None: e.g. the group has no SSTs needing compaction, all candidate levels are below the configured compaction threshold, or non-exclusive mode with no eligible task and not blocked by a pending task.","commonSituations":"Running manual compaction on an already-compact or nearly empty table/group; running it twice concurrently where the first has already compacted everything; misconfigured level thresholds making the group ineligible.","solutions":["No-op is fine: the group has nothing eligible to compact; skip the call.","If compaction is expected, verify SST layout and compaction config (levels, thresholds) for the compaction group.","If the request is exclusive and returns Retry, re-issue the trigger after the pending compaction commits."],"exampleFix":"// before\nlet task = get_compact_task(group).ok_or_else(|| anyhow!(\"No compaction_task is available. compaction_group {}\", group))?;\n// after\nmatch get_compact_task(group) {\n    Some(task) => proceed(task),\n    None => info!(group, \"nothing to compact\"), // treat as success/no-op\n}","handlingStrategy":"retry","validationCode":"// skip triggering when the group was recently compacted and nothing is eligible\nif group_has_pending_compaction(group) { return Ok(SkipReason::Pending); }","typeGuard":null,"tryCatchPattern":"match trigger_manual_compaction(opt).await {\n    Err(e) if e.to_string().contains(\"No compaction_task is available\") => {\n        // treat as benign no-op; schedule a later retry\n    },\n    other => other?,\n}","preventionTips":["Treat this error as a no-op signal, not a failure","Only trigger manual compaction when the group actually has eligible SSTs","Use exclusive mode + Retry semantics when coordinating concurrent triggers"],"tags":["compaction","hummock","no-op"],"backgroundTag":"empty-result-set","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}