{"record":{"id":"522f8e4dcb96caf6","repo":"risingwavelabs/risingwave","slug":"compaction-delete-files-count-threshold-must-be","errorCode":null,"errorMessage":"`compaction.delete_files_count_threshold` must be greater than 0","messagePattern":"`compaction\\.delete_files_count_threshold` must be greater than 0","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/config.rs","lineNumber":655,"sourceCode":"            return Err(SinkError::Config(anyhow!(\n                \"`compaction.trigger_snapshot_count` must be greater than 0\"\n            )));\n        }\n\n        if config.max_snapshots_num_before_compaction == Some(0) {\n            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!(","sourceCodeStart":637,"sourceCodeEnd":673,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/config.rs#L637-L673","documentation":"Numeric option validation in IcebergSinkConfig::from_btreemap: `compaction.delete_files_count_threshold` was set to 0, meaning compaction would trigger on any delete-file presence. The guard enforces a strictly positive threshold when the sink config is built from with-clause properties.","triggerScenarios":"CREATE SINK with `compaction.delete_files_count_threshold = 0` in the WITH options.","commonSituations":"Zero placeholder in tooling; misunderstanding that 0 disables delete-file compaction; bulk-edited config files.","solutions":["Set `delete_files_count_threshold` to a positive integer, e.g. 10.","Remove the option to use the default."],"exampleFix":"// before\nWITH (connector = 'iceberg', delete_files_count_threshold = 0)\n// after\nWITH (connector = 'iceberg', delete_files_count_threshold = 10)","handlingStrategy":"validation","validationCode":"if (opts.delete_files_count_threshold != null && Number(opts.delete_files_count_threshold) <= 0) {\n  throw new Error('`compaction.delete_files_count_threshold` 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('delete_files_count_threshold')) {\n    delete opts.delete_files_count_threshold;\n    return createIcebergSink(opts);\n  }\n  throw e;\n}","preventionTips":["Enforce >= 1 for count thresholds in config validation.","Review bulk-edited sink configs for zeroed values.","Document that 0 is invalid for compaction counts."],"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"}