{"record":{"id":"b192e33e1bc40b32","repo":"risingwavelabs/risingwave","slug":"compaction-interval-sec-must-be-greater-than-0-w","errorCode":null,"errorMessage":"`compaction-interval-sec` must be greater than 0 when `enable-compaction` is true","messagePattern":"`compaction-interval-sec` must be greater than 0 when `enable-compaction` is true","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/iceberg/mod.rs","lineNumber":312,"sourceCode":"                    && iceberg_config.write_mode == IcebergWriteMode::MergeOnRead);\n\n            // Persisted COW types are legacy-only and must not block compaction activation.\n            if validate_explicit_type {\n                validate_explicit_compaction_type(&iceberg_config)?;\n            }\n            validate_compaction_option_compatibility(&iceberg_config)?;\n        }\n\n        Self::validate_alter_config(config)\n    }\n\n    fn validate_alter_config(config: &BTreeMap<String, String>) -> Result<()> {\n        let iceberg_config = IcebergConfig::from_btreemap(config.clone())?;\n\n        // Validate compaction interval\n        if let Some(compaction_interval) = iceberg_config.compaction_interval_sec {\n            if iceberg_config.enable_compaction && compaction_interval == 0 {\n                bail!(\n                    \"`compaction-interval-sec` must be greater than 0 when `enable-compaction` is true\"\n                );\n            }\n\n            tracing::info!(\n                \"Alter config compaction_interval set to {} seconds\",\n                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            );","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/iceberg/mod.rs#L294-L330","documentation":"When altering an Iceberg sink's configuration, if compaction is enabled and a compaction interval is supplied, the interval must be a positive number of seconds. An interval of 0 combined with `enable-compaction=true` would schedule compaction constantly, so validation rejects it.","triggerScenarios":"`ALTER SINK ... SET` (validate_alter_config) with `enable-compaction` true and `compaction-interval-sec = '0'`.","commonSituations":"Users trying to disable compaction by setting the interval to 0 instead of `enable-compaction=false`; copy-paste of a placeholder value.","solutions":["Set `compaction-interval-sec` to a positive integer, e.g. `60`.","Set `enable-compaction=false` instead of zeroing the interval if you want compaction off.","Remove `compaction-interval-sec` to use the default interval while keeping compaction enabled."],"exampleFix":"-- before\nALTER SINK s SET ('enable-compaction'='true', 'compaction-interval-sec'='0');\n-- after\nALTER SINK s SET ('enable-compaction'='true', 'compaction-interval-sec'='60');","handlingStrategy":"validation","validationCode":"fn valid_interval(cfg: &std::collections::BTreeMap<String, String>) -> Result<(), String> {\n    let enabled = cfg.get(\"enable-compaction\").map(|v| v == \"true\").unwrap_or(false);\n    if enabled {\n        if let Some(s) = cfg.get(\"compaction-interval-sec\") {\n            if s.parse::<u64>().unwrap_or(0) == 0 {\n                return Err(\"compaction-interval-sec must be > 0 when enable-compaction is true\".into());\n            }\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use enable-compaction=false to disable compaction, never interval 0.","Keep all compaction* properties in one reviewed config block.","Validate positive integers with a script before issuing ALTER SINK."],"tags":["iceberg","sink","config","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-14T21:17:11.552Z"}