{"record":{"id":"4fbeaa98b4fdb6d3","repo":"risingwavelabs/risingwave","slug":"unsupported-task-type-for-copy-on-write-iceberg-co","errorCode":null,"errorMessage":"Unsupported task type for copy-on-write iceberg compaction: {task_type:?}","messagePattern":"Unsupported task type for copy-on-write iceberg compaction: (.+?)","errorType":"exception","errorClass":"HummockError","httpStatus":null,"severity":"error","filePath":"src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs","lineNumber":120,"sourceCode":"}\n\n#[derive(Debug, Clone, Copy, PartialEq, Eq)]\npub(crate) enum IcebergCompactionKind {\n    Auto,\n    SmallFiles,\n    Full,\n    FilesWithDeletes,\n    CopyOnWriteAuto,\n    CopyOnWrite,\n}\n\nimpl IcebergCompactionKind {\n    fn resolve(task_type: TaskType, iceberg_config: &IcebergConfig) -> HummockResult<Self> {\n        if should_enable_iceberg_cow(iceberg_config.r#type.as_str(), iceberg_config.write_mode) {\n            return match task_type {\n                TaskType::Auto => Ok(Self::CopyOnWriteAuto),\n                TaskType::Full => Ok(Self::CopyOnWrite),\n                _ => Err(HummockError::compaction_executor(anyhow::anyhow!(\n                    \"Unsupported task type for copy-on-write iceberg compaction: {task_type:?}\"\n                ))),\n            };\n        }\n\n        match task_type {\n            TaskType::Auto => Ok(Self::Auto),\n            TaskType::SmallFiles => Ok(Self::SmallFiles),\n            TaskType::Full => Ok(Self::Full),\n            TaskType::FilesWithDelete => Ok(Self::FilesWithDeletes),\n            _ => Err(HummockError::compaction_executor(anyhow::anyhow!(\n                \"Unsupported task type in iceberg compaction task: {task_type:?}\"\n            ))),\n        }\n    }\n\n    fn as_str(self) -> &'static str {\n        match self {","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs#L102-L138","documentation":"Iceberg copy-on-write compaction only supports a subset of compaction task types. resolve() maps a TaskType to an IcebergCompactionKind; when COW mode is enabled but the task is neither Auto nor Full, the executor refuses the task via HummockError::compaction_executor.","triggerScenarios":"Submitting an iceberg compaction task with COW enabled whose task_type is e.g. Minor, Major, or any variant other than TaskType::Auto / TaskType::Full.","commonSituations":"Scheduling configs or manual compaction requests that specify an incremental task type while the cluster's IcebergConfig (type + write_mode) enables copy-on-write; mixing task-type settings across config changes.","solutions":["Set the compaction task type to TaskType::Full (or omit it / use Auto) when iceberg COW is enabled","Alternatively, change iceberg_config (type/write_mode) so COW is disabled if the desired task type is required","Audit the component that constructs the compaction task to align task_type with the current iceberg write mode"],"exampleFix":"// before\nlet task = CompactionTask { task_type: TaskType::Minor, .. };\n// after (with COW enabled)\nlet task = CompactionTask { task_type: TaskType::Full, .. };","handlingStrategy":"validation","validationCode":"fn is_valid_cow_task_type(t: TaskType, cow_enabled: bool) -> bool {\n    !cow_enabled || matches!(t, TaskType::Auto | TaskType::Full)\n}","typeGuard":"fn cow_compatible(t: &TaskType) -> bool { matches!(t, TaskType::Auto | TaskType::Full) }","tryCatchPattern":"match iceberg_compactor.resolve(task_type, &cfg) {\n    Err(e) if format!(\"{e:#}\").contains(\"Unsupported task type\") => {\n        // fall back to TaskType::Full or disable COW before resubmitting\n    }\n    other => other,\n}","preventionTips":["Keep compaction task_type configuration consistent with iceberg write_mode settings","Validate task types against the current iceberg config before scheduling","Write a unit test asserting every task_type maps or is explicitly rejected per write mode"],"tags":["rust","storage","hummock","iceberg","compaction"],"backgroundTag":"unsupported-enum-value","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"}