{"record":{"id":"c17ffd9cf20507de","repo":"risingwavelabs/risingwave","slug":"compaction-target-file-size-mb-must-be-greater-t-c17ffd","errorCode":null,"errorMessage":"`compaction.target_file_size_mb` must be greater than 0","messagePattern":"`compaction\\.target_file_size_mb` must be greater than 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/mod.rs","lineNumber":337,"sourceCode":"                compaction_interval\n            );\n        }\n\n        // Validate max snapshots\n        if let Some(max_snapshots) = iceberg_config.max_snapshots_num_before_compaction\n            && max_snapshots < 1\n        {\n            bail!(\n                \"`compaction.max_snapshots_num` must be greater than 0, got: {}\",\n                max_snapshots\n            );\n        }\n\n        // Validate target file size\n        if let Some(target_file_size_mb) = iceberg_config.target_file_size_mb\n            && target_file_size_mb == 0\n        {\n            bail!(\"`compaction.target_file_size_mb` must be greater than 0\");\n        }\n\n        // Validate parquet max row group rows\n        if let Some(max_row_group_rows) = iceberg_config.write_parquet_max_row_group_rows\n            && max_row_group_rows == 0\n        {\n            bail!(\"`compaction.write_parquet_max_row_group_rows` must be greater than 0\");\n        }\n\n        // Validate parquet max row group bytes\n        if let Some(max_row_group_bytes) = iceberg_config.write_parquet_max_row_group_bytes\n            && max_row_group_bytes == 0\n        {\n            bail!(\"`compaction.write_parquet_max_row_group_bytes` must be greater than 0\");\n        }\n\n        // Validate parquet compression codec\n        if let Some(ref compression) = iceberg_config.write_parquet_compression {","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/mod.rs#L319-L355","documentation":"Guard in validate_alter_config that re-checks compaction options on ALTER SINK: `compaction.max_snapshots_num` must be at least 1. Unlike the creation-time from_btreemap check, this one bails with the offending value interpolated, so the user sees exactly what was rejected.","triggerScenarios":"`ALTER SINK ... SET` with `compaction.target_file_size_mb = '0'`.","commonSituations":"Placeholder values left in generated configs; misunderstanding the unit (MB) and passing a fraction or 0; attempts to force maximal compaction.","solutions":["Set `compaction.target_file_size_mb` to a positive value, e.g. `128` or `512`.","Remove the property to use the default target file size.","Verify the unit is megabytes and that any computed/templated value is >= 1."],"exampleFix":"-- before\nALTER SINK s SET ('compaction.target_file_size_mb'='0');\n-- after\nALTER SINK s SET ('compaction.target_file_size_mb'='512');","handlingStrategy":"validation","validationCode":"fn valid_target_file_size(cfg: &std::collections::BTreeMap<String, String>) -> Result<(), String> {\n    if let Some(s) = cfg.get(\"compaction.target_file_size_mb\") {\n        if s.parse::<u64>().unwrap_or(0) == 0 {\n            return Err(\"compaction.target_file_size_mb must be > 0\".into());\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep values in MB (unit is part of the key name).","Use sane defaults like 128/256/512 unless profiling says otherwise.","Sanity-check any generated config numerically before ALTER SINK."],"tags":["iceberg","sink","config","compaction"],"backgroundTag":"value-out-of-range","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}