{"record":{"id":"1b458cb14459cd8a","repo":"risingwavelabs/risingwave","slug":"starrocks-max-batch-size-bytes-must-be-greater-t","errorCode":null,"errorMessage":"`starrocks.max_batch_size_bytes` must be greater than 0","messagePattern":"`starrocks\\.max_batch_size_bytes` must be greater than 0","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/starrocks.rs","lineNumber":174,"sourceCode":"    pub fn from_btreemap(properties: BTreeMap<String, String>) -> Result<Self> {\n        let config =\n            serde_json::from_value::<StarrocksConfig>(serde_json::to_value(properties).unwrap())\n                .map_err(|e| SinkError::Config(anyhow!(e)))?;\n        if config.r#type != SINK_TYPE_APPEND_ONLY && config.r#type != SINK_TYPE_UPSERT {\n            return Err(SinkError::Config(anyhow!(\n                \"`{}` must be {}, or {}\",\n                SINK_TYPE_OPTION,\n                SINK_TYPE_APPEND_ONLY,\n                SINK_TYPE_UPSERT\n            )));\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        if let Some(0) = config.max_batch_size_bytes {\n            return Err(SinkError::Config(anyhow!(\n                \"`starrocks.max_batch_size_bytes` must be greater than 0\"\n            )));\n        }\n        Ok(config)\n    }\n}\n\n#[derive(Debug, PartialEq, Eq)]\nstruct LoadRequestSizeDecision {\n    finish_current_load: bool,\n    next_batch_size_bytes: u64,\n}\n\nfn decide_load_request_size(\n    current_batch_size_bytes: u64,\n    row_size: u64,\n    max_batch_size_bytes: u64,\n) -> Result<LoadRequestSizeDecision> {","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/starrocks.rs#L156-L192","documentation":"This error is thrown by `StarrocksConfig::from_btreemap` when the user-provided property `starrocks.max_batch_size_bytes` is explicitly set to `0`. The batch size controls how many bytes are accumulated before flushing a stream-load batch to StarRocks; a zero value would prevent any batching from working, so the config is rejected at sink creation.","triggerScenarios":"Creating a StarRocks sink with a WITH option `starrocks.max_batch_size_bytes` = '0'. The check only fires on exactly `Some(0)`; unset or positive values pass.","commonSituations":"Copy-pasted sink DDL with a placeholder 0, templated configs where the variable was not substituted, or an attempt to disable batching by setting the size to zero (which is not supported).","solutions":["Set `starrocks.max_batch_size_bytes` to a positive byte value (e.g. '1048576') in the sink WITH options","Remove the option entirely to use the default batch size","Verify any SQL templating/variables actually substitute a positive integer"],"exampleFix":"// before\nCREATE SINK s FROM mv INTO starrocks WITH (\n  'starrocks.max_batch_size_bytes' = '0'\n);\n// after\nCREATE SINK s FROM mv INTO starrocks WITH (\n  'starrocks.max_batch_size_bytes' = '1048576'\n);","handlingStrategy":"validation","validationCode":"let batch = props.get(\"starrocks.max_batch_size_bytes\").map(|v| v.parse::<u64>().ok());\nif batch == Some(Some(0)) {\n    return Err(\"starrocks.max_batch_size_bytes must be > 0\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never template sink options with 0 placeholders; use defaults","Validate all sink WITH options before running CREATE SINK"],"tags":["config","starrocks","sink"],"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-23T08:17:48.524Z"}