{"record":{"id":"02f47319fae37049","repo":"risingwavelabs/risingwave","slug":"compaction-interval-sec-must-be-greater-than-0","errorCode":null,"errorMessage":"`compaction_interval_sec` must be greater than 0","messagePattern":"`compaction_interval_sec` must be greater than 0","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/config.rs","lineNumber":631,"sourceCode":"\n        // All configs start with \"catalog.\" will be treated as java configs.\n        config.java_catalog_props = iceberg_java_catalog_props_from_options(\n            values\n                .iter()\n                .map(|(key, value)| (key.as_str(), value.as_str())),\n        );\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!(","sourceCodeStart":613,"sourceCodeEnd":649,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/config.rs#L613-L649","documentation":"Raised when `compaction_interval_sec` is explicitly set to Some(0) on an Iceberg sink config. The compaction interval must be a positive number of seconds; zero is meaningless and rejected at parse time.","triggerScenarios":"CREATE SINK with `compaction_interval_sec = 0` in the WITH options of an Iceberg sink.","commonSituations":"Users trying to 'disable' compaction by setting the interval to 0 instead of omitting the option; templated configs with unset variables defaulting to 0.","solutions":["Set `compaction_interval_sec` to a positive integer, e.g. 300.","Remove the option to use the built-in default.","To reduce compaction, set a large interval rather than 0."],"exampleFix":"// before\nWITH (connector = 'iceberg', compaction_interval_sec = 0)\n// after\nWITH (connector = 'iceberg', compaction_interval_sec = 300)","handlingStrategy":"validation","validationCode":"if (opts.compaction_interval_sec != null && Number(opts.compaction_interval_sec) <= 0) {\n  throw new Error('`compaction_interval_sec` 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('compaction_interval_sec')) {\n    delete opts.compaction_interval_sec;\n    return createIcebergSink(opts);\n  }\n  throw e;\n}","preventionTips":["Treat 0 as invalid for all compaction.* numeric options.","Disable compaction by removing the option, not by zeroing values.","Validate config templates before rendering DDL."],"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"}