{"record":{"id":"f13425038377d956","repo":"risingwavelabs/risingwave","slug":"bounded-compaction-requires-iceberg-format-v2-or-v","errorCode":null,"errorMessage":"bounded compaction requires Iceberg format V2 or V3","messagePattern":"bounded compaction requires Iceberg format V2 or V3","errorType":"exception","errorClass":"HummockError","httpStatus":null,"severity":"error","filePath":"src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs","lineNumber":962,"sourceCode":"        && (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            )));\n        }\n        let head = table.metadata().snapshot_for_ref(&branch).ok_or_else(|| {\n            HummockError::compaction_executor(anyhow::anyhow!(\n                \"bounded compaction branch {branch} has no snapshot\"\n            ))\n        })?;\n        if head.sequence_number() < boundary {\n            return Err(HummockError::compaction_executor(anyhow::anyhow!(\n                \"bounded compaction head sequence {} is older than boundary {}\",\n                head.sequence_number(),\n                boundary\n            )));\n        }\n    }\n\n    let planning_config = build_task_planning_config(","sourceCodeStart":944,"sourceCodeEnd":980,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/storage/src/hummock/compactor/iceberg_compaction/iceberg_compactor_runner.rs#L944-L980","documentation":"Bounded compaction is validated against max_file_sequence_number, which is meaningful only for Iceberg format V2+ where sequence numbers exist on snapshots/data files. If the loaded table metadata reports format_version < V2 (i.e. V1), the runner fails closed rather than silently treating the boundary as meaningless.","triggerScenarios":"A compaction request with max_file_sequence_number is submitted for an Iceberg table whose metadata format_version is 1 (created as a V1 table or downgraded), in create_task_execution.","commonSituations":"The Iceberg table was originally created in V1 format by external tooling and later pointed at RisingWave; user assumed V2 defaults but the catalog/table was created with format-version=1.","solutions":["Upgrade the table to Iceberg format V2 (rewrite metadata with a migration tool such as Spark's Iceberg migrations: CALL catalog.system.migrate_table / snapshot/update procedures).","Recreate the iceberg sink/table with format-version = 2 (or 3) and backfill data.","Submit the compaction without max_file_sequence_number if V1 must remain for now.","Check the table's metadata.json format-version field to confirm what the catalog actually created."],"exampleFix":"// before: table created with format-version = 1\n// spark.sql CREATE TABLE ... TBLPROPERTIES('format-version'='1')\n\n// after\n// spark.sql CREATE TABLE ... TBLPROPERTIES('format-version'='2')","handlingStrategy":"validation","validationCode":"fn supports_bounded_compaction(table: &Table) -> bool {\n    table.metadata().format_version() >= FormatVersion::V2\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create all Iceberg tables with format-version = 2 or 3.","Migrate legacy V1 tables before enabling sequence-number-bounded compaction.","Check metadata.json format-version when onboarding an externally created table."],"tags":["rust","iceberg","format-version","bounded-compaction"],"backgroundTag":"invalid-config-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"}