{"record":{"id":"1e3ae9bd95e76292","repo":"risingwavelabs/risingwave","slug":"iceberg-compaction-maintenance-was-cleared-for-sin","errorCode":null,"errorMessage":"Iceberg compaction maintenance was cleared for sink {}","messagePattern":"Iceberg compaction maintenance was cleared for sink (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/meta/src/manager/iceberg_compaction/schedule.rs","lineNumber":1070,"sourceCode":"            .into()));\n        }\n\n        handles\n    }\n\n    pub fn clear_iceberg_maintenance_by_sink_id(&self, sink_id: SinkId) {\n        let (task_to_cancel, waiter) = {\n            let mut guard = self.inner.write();\n            let task_to_cancel = Self::remove_sink_schedule(&mut guard, sink_id);\n            guard.snapshot_expiration_sink_ids.remove(&sink_id);\n            guard.manifest_rewrite_sink_ids.remove(&sink_id);\n            let waiter = guard.manual_compaction_waiters.remove(&sink_id);\n            (task_to_cancel, waiter)\n        };\n        self.cancel_scheduled_task_if_any(sink_id, task_to_cancel);\n\n        if let Some(waiter) = waiter {\n            let _ = waiter.send(Err(anyhow!(\n                \"Iceberg compaction maintenance was cleared for sink {}\",\n                sink_id\n            )\n            .into()));\n        }\n    }\n\n    fn remove_sink_schedule(\n        guard: &mut IcebergCompactionManagerInner,\n        sink_id: SinkId,\n    ) -> Option<ScheduledCompactionTask> {\n        guard\n            .sink_schedules\n            .remove(&sink_id)\n            .and_then(|track| track.scheduled_task())\n    }\n\n    fn cancel_scheduled_task_if_any(&self, sink_id: SinkId, task: Option<ScheduledCompactionTask>) {","sourceCodeStart":1052,"sourceCodeEnd":1088,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/manager/iceberg_compaction/schedule.rs#L1052-L1088","documentation":"This error is delivered to a manual compaction waiter when the sink's compaction maintenance is cleared (e.g. sink deletion or schedule teardown via clear/stop paths). The pending oneshot waiter is removed and resolved with this Err, and any scheduled task for the sink is cancelled, so the caller learns their manual compaction will never complete.","triggerScenarios":"A caller awaits the Receiver from start_manual_compaction while clear_compaction_state / sink teardown runs: the waiter is removed from manual_compaction_waiters, the scheduled task is cancelled, and the waiter receives this error.","commonSituations":"The Iceberg sink (materialized view/sink) is dropped while a manual compaction is pending; admin clears compaction maintenance; meta-side state cleanup after sink recreation.","solutions":["Treat it as expected cancellation if you dropped or recreated the sink; re-trigger compaction on the new sink","Check whether another operator/admin cleared maintenance concurrently","Re-issue the manual compaction once the sink's schedule is re-established","Coordinate sink lifecycle operations with compaction operations to avoid racing them"],"exampleFix":"// before\nlet task_id = rx.await??; // Err: maintenance cleared\n// after\nmatch rx.await {\n    Ok(Ok(task_id)) => Ok(task_id),\n    Ok(Err(e)) if e.to_string().contains(\"maintenance was cleared\") => {\n        info!(\"compaction cancelled by sink teardown\");\n        Err(SinkCompactionCancelled)\n    }\n    r => r,\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match rx.await {\n    Ok(Ok(task_id)) => Ok(task_id),\n    Ok(Err(e)) if e.to_string().contains(\"maintenance was cleared\") => {\n        info!(\"manual compaction cancelled by sink teardown; not an error if sink was dropped\");\n        Ok(CompactionOutcome::Cancelled)\n    }\n    other => other,\n}","preventionTips":["Avoid dropping/recreating the sink while a manual compaction is in flight","Coordinate sink lifecycle changes with compaction operations","Treat this error as cancellation, not failure, and re-trigger on the new sink if needed"],"tags":["iceberg","compaction","cancelled","lifecycle"],"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-23T08:17:48.524Z"}