{"record":{"id":"ee0867782ebbf47d","repo":"risingwavelabs/risingwave","slug":"manual-full-compaction-is-rejected-while-an-automa","errorCode":null,"errorMessage":"manual Full compaction is rejected while an automatic round is active for sink {}","messagePattern":"manual Full compaction is rejected while an automatic round is active for sink (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/meta/src/manager/iceberg_compaction/schedule.rs","lineNumber":918,"sourceCode":"                SinkUpdateKind::ManualForceCompaction {\n                    task_type: TaskType::Full,\n                },\n                Instant::now(),\n            )\n            .await;\n        let mut guard = self.inner.write();\n        let now = Instant::now();\n        if guard.manual_compaction_waiters.contains_key(&sink_id) {\n            return Err(anyhow!(\n                \"manual iceberg compaction is already waiting for sink {}\",\n                sink_id\n            )\n            .into());\n        }\n\n        if let Some(track) = guard.sink_schedules.get(&sink_id) {\n            if track.round_max_file_sequence_number.is_some() {\n                return Err(anyhow!(\n                    \"manual Full compaction is rejected while an automatic round is active for sink {}\",\n                    sink_id\n                )\n                .into());\n            }\n            match &track.state {\n                CompactionTrackState::PendingDispatch { attempt } => {\n                    return Err(anyhow!(\n                        \"iceberg compaction task is already running for sink {} \\\n                         (state=pending_dispatch, pending_commit_count_at_start={}, \\\n                         pending_commit_count={})\",\n                        sink_id,\n                        attempt.pending_commit_count_at_start,\n                        track.pending_commit_count\n                    )\n                    .into());\n                }\n                CompactionTrackState::InFlight {","sourceCodeStart":900,"sourceCodeEnd":936,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/manager/iceberg_compaction/schedule.rs#L900-L936","documentation":"This error comes from the Iceberg compaction scheduler in the RisingWave meta node when a manual Full compaction is requested via start_manual_compaction. The sink already has an automatic compaction round in progress (round_max_file_sequence_number is set), and running a manual Full compaction concurrently with it is not allowed. The request is rejected instead of being queued, so the caller must retry after the automatic round finishes.","triggerScenarios":"Calling start_manual_compaction (e.g. via a manual compaction API/SQL command) for a sink whose sink_schedules track has round_max_file_sequence_number set to Some, meaning an automatic compaction round is currently active.","commonSituations":"Operators triggering manual full compaction while periodic/automatic compaction (triggered by snapshot count or interval) is still running for the same Iceberg sink; racing another admin's manual trigger right after auto-compaction kicked off.","solutions":["Wait for the automatic compaction round to complete, then retry the manual Full compaction","Check the sink's compaction state/progress (logs tagged iceberg_operation) before triggering manual compaction","Adjust compaction_interval_sec / trigger_snapshot_count so automatic rounds are less likely to overlap with maintenance windows","If stuck, cancel or wait for the automatic round via the sink lifecycle; note restarts of the meta node reset in-memory track state"],"exampleFix":"// before\nmanager.start_manual_compaction(sink_id).await?; // Err: auto round active\n// after\nif !manager.auto_round_active(&sink_id) {\n    manager.start_manual_compaction(sink_id).await?;\n} else {\n    schedule_retry_after_auto_round(sink_id);\n}","handlingStrategy":"validation","validationCode":"// Check track state before requesting manual compaction\nfn can_request_manual_compaction(track: Option<&CompactionTrack>) -> bool {\n    track\n        .map(|t| t.round_max_file_sequence_number.is_none()\n            && matches!(t.state, CompactionTrackState::Idle { .. }))\n        .unwrap_or(true)\n}","typeGuard":"fn is_auto_round_active(track: &CompactionTrack) -> bool {\n    track.round_max_file_sequence_number.is_some()\n}","tryCatchPattern":null,"preventionTips":["Check the sink's compaction state before issuing manual Full compaction","Schedule manual compaction outside automatic compaction windows","Serialize admin compaction operations through a single operator/tool","On rejection, back off and retry after the auto round completes rather than hammering the API"],"tags":["iceberg","compaction","state-conflict","concurrency"],"backgroundTag":"invalid-state-transition","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}