{"record":{"id":"e1a36c9773dd2cdd","repo":"risingwavelabs/risingwave","slug":"compaction-trigger-snapshot-count-must-be-greate","errorCode":null,"errorMessage":"`compaction.trigger_snapshot_count` must be greater than 0","messagePattern":"`compaction\\.trigger_snapshot_count` must be greater than 0","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/config.rs","lineNumber":637,"sourceCode":"        );\n        config\n            .unknown_fields\n            .retain(|key, _| key != \"connector\" && !key.starts_with(\"catalog.\"));\n\n        if config.commit_checkpoint_interval == 0 {\n            return Err(SinkError::Config(anyhow!(\n                \"`commit-checkpoint-interval` must be greater than 0\"\n            )));\n        }\n\n        if config.compaction_interval_sec == Some(0) {\n            return Err(SinkError::Config(anyhow!(\n                \"`compaction_interval_sec` must be greater than 0\"\n            )));\n        }\n\n        if config.trigger_snapshot_count == Some(0) {\n            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!(","sourceCodeStart":619,"sourceCodeEnd":655,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/config.rs#L619-L655","documentation":"Raised when `trigger_snapshot_count` is Some(0) in an Iceberg sink config. This option controls how many snapshots trigger compaction; it must be at least 1. Zero is rejected during from_btreemap validation.","triggerScenarios":"CREATE SINK with `compaction.trigger_snapshot_count = 0` (option `trigger_snapshot_count`) in the WITH options.","commonSituations":"Placeholder values in generated DDL; users experimenting with compaction thresholds and entering 0; confusion between 'count' and 'disabled'.","solutions":["Set `trigger_snapshot_count` to a positive integer, e.g. 5.","Remove the option to rely on the default trigger count.","If compaction is unwanted, adjust `compaction_interval_sec` instead of zeroing thresholds."],"exampleFix":"// before\nWITH (connector = 'iceberg', trigger_snapshot_count = 0)\n// after\nWITH (connector = 'iceberg', trigger_snapshot_count = 5)","handlingStrategy":"validation","validationCode":"if (opts.trigger_snapshot_count != null && Number(opts.trigger_snapshot_count) <= 0) {\n  throw new Error('`compaction.trigger_snapshot_count` 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('trigger_snapshot_count')) {\n    delete opts.trigger_snapshot_count;\n    return createIcebergSink(opts);\n  }\n  throw e;\n}","preventionTips":["Use >= 1 for all count-type thresholds.","Validate user-supplied tuning values in tooling.","Document that 0 is rejected 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"}