{"record":{"id":"aefe9b8817e2d11c","repo":"risingwavelabs/risingwave","slug":"compaction-target-file-size-mb-must-be-greater-t","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":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/config.rs","lineNumber":661,"sourceCode":"            return Err(SinkError::Config(anyhow!(\n                \"`compaction.max_snapshots_num` must be greater than 0\"\n            )));\n        }\n\n        if config.small_files_threshold_mb == Some(0) {\n            return Err(SinkError::Config(anyhow!(\n                \"`compaction.small_files_threshold_mb` must be greater than 0\"\n            )));\n        }\n\n        if config.delete_files_count_threshold == Some(0) {\n            return Err(SinkError::Config(anyhow!(\n                \"`compaction.delete_files_count_threshold` must be greater than 0\"\n            )));\n        }\n\n        if config.target_file_size_mb == Some(0) {\n            return Err(SinkError::Config(anyhow!(\n                \"`compaction.target_file_size_mb` must be greater than 0\"\n            )));\n        }\n\n        if config.write_parquet_max_row_group_rows == Some(0) {\n            return Err(SinkError::Config(anyhow!(\n                \"`compaction.write_parquet_max_row_group_rows` must be greater than 0\"\n            )));\n        }\n\n        if config.write_parquet_max_row_group_bytes == Some(0) {\n            return Err(SinkError::Config(anyhow!(\n                \"`compaction.write_parquet_max_row_group_bytes` must be greater than 0\"\n            )));\n        }\n\n        if config.manifest_rewrite_target_size_bytes == Some(0) {\n            return Err(SinkError::Config(anyhow!(","sourceCodeStart":643,"sourceCodeEnd":679,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/config.rs#L643-L679","documentation":"Numeric option validation in IcebergSinkConfig::from_btreemap: `compaction.target_file_size_mb` was set to 0, which would produce zero-byte target files during compaction. The guard rejects non-positive values while parsing the sink's with-clause options.","triggerScenarios":"CREATE SINK with `compaction.target_file_size_mb = 0` in the WITH options.","commonSituations":"Zero placeholder values; users attempting 'write everything as small files' experiments; unit confusion when copying configs from other systems.","solutions":["Set `target_file_size_mb` to a positive integer, e.g. 128.","Remove the option to use the Iceberg default target file size."],"exampleFix":"// before\nWITH (connector = 'iceberg', target_file_size_mb = 0)\n// after\nWITH (connector = 'iceberg', target_file_size_mb = 128)","handlingStrategy":"validation","validationCode":"if (opts.target_file_size_mb != null && Number(opts.target_file_size_mb) <= 0) {\n  throw new Error('`compaction.target_file_size_mb` must be greater than 0');\n}","typeGuard":"function isValidOptionalPositive(v) {\n  return v == null || (Number.isInteger(v) && v > 0);\n}","tryCatchPattern":"try {\n  await createIcebergSink(opts);\n} catch (e) {\n  if (String(e).includes('target_file_size_mb')) {\n    delete opts.target_file_size_mb;\n    return createIcebergSink(opts);\n  }\n  throw e;\n}","preventionTips":["Validate file-size options are positive.","Don't copy target_file_size_mb defaults from other systems that use 0 as unset.","Omit the option to use the Iceberg table default."],"tags":["iceberg","sink","config-validation","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"}