{"record":{"id":"56fa0ce432b485ba","repo":"risingwavelabs/risingwave","slug":"failed-to-trigger-manual-iceberg-compaction-for-si","errorCode":null,"errorMessage":"failed to trigger manual iceberg compaction for sink {}","messagePattern":"failed to trigger manual iceberg compaction for sink (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/manager/iceberg_compaction/schedule.rs","lineNumber":963,"sourceCode":"                         pending_commit_count={}, report_timeout_after_sec={})\",\n                        sink_id,\n                        task_id,\n                        attempt.pending_commit_count_at_start,\n                        track.pending_commit_count,\n                        report_deadline.saturating_duration_since(now).as_secs()\n                    )\n                    .into());\n                }\n                CompactionTrackState::Idle { .. } => {}\n            }\n        }\n\n        if self.apply_sink_update(&mut guard, prepared_update) {\n            let (tx, rx) = oneshot::channel();\n            guard.manual_compaction_waiters.insert(sink_id, tx);\n            Ok(rx)\n        } else {\n            Err(anyhow!(\n                \"failed to trigger manual iceberg compaction for sink {}\",\n                sink_id\n            )\n            .into())\n        }\n    }\n\n    pub(super) fn cancel_manual_compaction_waiter(&self, sink_id: SinkId) {\n        self.inner\n            .write()\n            .manual_compaction_waiters\n            .remove(&sink_id);\n    }\n\n    fn finish_timed_out_compaction_tasks(\n        guard: &mut IcebergCompactionManagerInner,\n        now: Instant,\n    ) -> Vec<(SinkId, ManualCompactionWaiter)> {","sourceCodeStart":945,"sourceCodeEnd":981,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/manager/iceberg_compaction/schedule.rs#L945-L981","documentation":"start_manual_compaction prepared a manual Full compaction update for the sink but apply_sink_update returned false, meaning the prepared update could not be applied to the manager state (e.g. the sink has no registered schedule or the state changed after preparation). The internal oneshot waiter is never registered and an error is returned to the caller.","triggerScenarios":"Calling start_manual_compaction when the sink has no entry in sink_schedules or its track state does not permit applying the ManualForceCompaction update (apply_sink_update returns false).","commonSituations":"Manual compaction issued for a sink ID that does not exist / whose sink was just dropped, or the sink never had automatic compaction configured so no schedule track exists; race where the track is mutated between prepare and apply.","solutions":["Verify the sink ID is correct and the sink exists with Iceberg compaction enabled","Check whether the sink has a compaction schedule (automatic compaction configured) before issuing manual compaction","Retry: the mismatch may be a transient race between prepare and apply","If the sink was dropped concurrently, re-create the sink or abandon the compaction request"],"exampleFix":"// before\nlet rx = manager.start_manual_compaction(sink_id.clone()).await?;\n// after\nif !manager.sink_exists(&sink_id) {\n    return Err(anyhow!(\"sink {} not found; cannot compact\", sink_id));\n}\nlet rx = manager.start_manual_compaction(sink_id.clone()).await\n    .map_err(|e| e.context(\"ensure sink has compaction schedule before manual trigger\"))?;","handlingStrategy":"validation","validationCode":"// Verify the sink exists and has a compaction schedule before triggering\nfn manual_compaction_applicable(sink_exists: bool, has_schedule: bool) -> bool {\n    sink_exists && has_schedule\n}","typeGuard":null,"tryCatchPattern":"match start_manual_compaction(sink_id).await {\n    Err(e) if e.to_string().contains(\"failed to trigger\") => {\n        Err(anyhow!(\"sink {} missing or has no compaction schedule\", sink_id).context(e))\n    }\n    other => other,\n}","preventionTips":["Confirm the sink ID via catalog queries before manual compaction","Only trigger manual compaction for sinks with automatic compaction configured","Re-check sink existence right before triggering to avoid races with drops"],"tags":["iceberg","compaction","invalid-argument","sink-not-found"],"backgroundTag":"entity-not-found","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}