{"record":{"id":"63b08d18daf8185e","repo":"risingwavelabs/risingwave","slug":"bounded-compaction-is-not-supported-for-copy-on-wr","errorCode":null,"errorMessage":"bounded compaction is not supported for copy-on-write tasks","messagePattern":"bounded compaction is not supported for copy-on-write tasks","errorType":"exception","errorClass":"HummockError","httpStatus":null,"severity":"error","filePath":"src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs","lineNumber":946,"sourceCode":"    let iceberg_config = IcebergConfig::from_btreemap(BTreeMap::from_iter(props))\n        .map_err(|e| HummockError::compaction_executor(e.as_report()))?;\n\n    let catalog = iceberg_config\n        .create_catalog()\n        .await\n        .map_err(|e| HummockError::compaction_executor(e.as_report()))?;\n\n    let table_ident = iceberg_config\n        .full_table_name()\n        .map_err(|e| HummockError::compaction_executor(e.as_report()))?;\n\n    let parsed_task_type = TaskType::try_from(task_type)\n        .map_err(|e| HummockError::compaction_executor(e.as_report()))?;\n    let compaction_kind = IcebergCompactionKind::resolve(parsed_task_type, &iceberg_config)?;\n    if max_file_sequence_number.is_some()\n        && (pk_index_coordinated || compaction_kind.is_copy_on_write())\n    {\n        return Err(HummockError::compaction_executor(anyhow::anyhow!(\n            \"bounded compaction is not supported for copy-on-write tasks\"\n        )));\n    }\n\n    let branch = commit_branch(iceberg_config.r#type.as_str(), iceberg_config.write_mode);\n\n    let table = catalog\n        .load_table(&table_ident)\n        .await\n        .map_err(|e| HummockError::compaction_executor(e.as_report()))?;\n\n    if let Some(boundary) = max_file_sequence_number {\n        // An empty bounded plan is reported as `Drained`, so fail closed unless\n        // the loaded branch can prove that this fixed boundary is meaningful.\n        if table.metadata().format_version() < FormatVersion::V2 {\n            return Err(HummockError::compaction_executor(anyhow::anyhow!(\n                \"bounded compaction requires Iceberg format V2 or V3\"\n            )));","sourceCodeStart":928,"sourceCodeEnd":964,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs#L928-L964","documentation":"create_task_execution rejects bounded iceberg compaction (a request carrying max_file_sequence_number) when the resolved compaction kind is copy-on-write, or when the task is pk-index coordinated. Bounded compaction relies on append/sequence-number semantics that COW publishes cannot honor, since each COW plan rewrites and publishes whole table state.","triggerScenarios":"start_iceberg_compactor receives a task with max_file_sequence_number set while the resolved IcebergCompactionKind is CopyOnWrite/CopyOnWriteAuto (COW write mode), or pk_index_coordinated is true with a sequence-number boundary.","commonSituations":"A user or tooling submits a bounded/incremental compaction request against an iceberg sink configured with write_mode = copy-on-write; meta sends a sequence-number-bounded task to a COW table after a config switch mid-flight.","solutions":["Remove max_file_sequence_number from the compaction request so it runs as an unbounded task.","Switch the iceberg table write_mode from copy-on-write to merge-on-read if bounded (incremental) compaction is required.","Re-issue the request without a sequence boundary when using pk-index coordinated compaction.","Align the client/tooling generating the request with the table's current write mode."],"exampleFix":"// before\n// request with max_file_sequence_number = 42 against write_mode = \"copy-on-write\"\n\n// after: either drop the boundary\n// max_file_sequence_number = null\n// or change table config\n[iceberg_compaction]\nwrite_mode = \"merge-on-read\"","handlingStrategy":"validation","validationCode":"fn is_bounded(req: &CompactionRequest) -> bool { req.max_file_sequence_number.is_some() }\n// reject before submitting:\nif is_bounded(req) && write_mode == WriteMode::CopyOnWrite { return Err(\"bounded compaction unsupported for COW\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only send max_file_sequence_number for merge-on-read iceberg tables.","Keep coordinator-side request builders aware of each table's write_mode.","Re-validate in-flight requests after switching a table's write mode."],"tags":["rust","iceberg","compaction","copy-on-write","unsupported"],"backgroundTag":"unsupported-operation","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"}