risingwavelabs/risingwave · error · HummockError

Unsupported task type for copy-on-write iceberg compaction:

Error message

Unsupported task type for copy-on-write iceberg compaction: {task_type:?}

What it means

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.

Source

Thrown at src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs:120

}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum IcebergCompactionKind {
    Auto,
    SmallFiles,
    Full,
    FilesWithDeletes,
    CopyOnWriteAuto,
    CopyOnWrite,
}

impl IcebergCompactionKind {
    fn resolve(task_type: TaskType, iceberg_config: &IcebergConfig) -> HummockResult<Self> {
        if should_enable_iceberg_cow(iceberg_config.r#type.as_str(), iceberg_config.write_mode) {
            return match task_type {
                TaskType::Auto => Ok(Self::CopyOnWriteAuto),
                TaskType::Full => Ok(Self::CopyOnWrite),
                _ => Err(HummockError::compaction_executor(anyhow::anyhow!(
                    "Unsupported task type for copy-on-write iceberg compaction: {task_type:?}"
                ))),
            };
        }

        match task_type {
            TaskType::Auto => Ok(Self::Auto),
            TaskType::SmallFiles => Ok(Self::SmallFiles),
            TaskType::Full => Ok(Self::Full),
            TaskType::FilesWithDelete => Ok(Self::FilesWithDeletes),
            _ => Err(HummockError::compaction_executor(anyhow::anyhow!(
                "Unsupported task type in iceberg compaction task: {task_type:?}"
            ))),
        }
    }

    fn as_str(self) -> &'static str {
        match self {

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Set the compaction task type to TaskType::Full (or omit it / use Auto) when iceberg COW is enabled
  2. Alternatively, change iceberg_config (type/write_mode) so COW is disabled if the desired task type is required
  3. Audit the component that constructs the compaction task to align task_type with the current iceberg write mode

Example fix

// before
let task = CompactionTask { task_type: TaskType::Minor, .. };
// after (with COW enabled)
let task = CompactionTask { task_type: TaskType::Full, .. };
Defensive patterns

Strategy: validation

Validate before calling

fn is_valid_cow_task_type(t: TaskType, cow_enabled: bool) -> bool {
    !cow_enabled || matches!(t, TaskType::Auto | TaskType::Full)
}

Type guard

fn cow_compatible(t: &TaskType) -> bool { matches!(t, TaskType::Auto | TaskType::Full) }

Try / catch

match iceberg_compactor.resolve(task_type, &cfg) {
    Err(e) if format!("{e:#}").contains("Unsupported task type") => {
        // fall back to TaskType::Full or disable COW before resubmitting
    }
    other => other,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/4fbeaa98b4fdb6d3. Report an issue: GitHub.