{"record":{"id":"ea2ce01a14254893","repo":"risingwavelabs/risingwave","slug":"debug-splits-is-not-allowed-in-release-mode","errorCode":null,"errorMessage":"`debug_splits` is not allowed in release mode","messagePattern":"`debug_splits` is not allowed in release mode","errorType":"exception","errorClass":"ConnectorError","httpStatus":null,"severity":"error","filePath":"src/meta/src/stream/source_manager/worker.rs","lineNumber":101,"sourceCode":"}\n\nfn extract_prop_from_existing_source(source: &Source) -> ConnectorResult<ConnectorProperties> {\n    let options_with_secret =\n        WithOptionsSecResolved::new(source.with_properties.clone(), source.secret_refs.clone());\n    let mut properties = ConnectorProperties::extract(options_with_secret, false)?;\n    properties.init_from_pb_source(source);\n    Ok(properties)\n}\nfn extract_prop_from_new_source(source: &Source) -> ConnectorResult<ConnectorProperties> {\n    let options_with_secret = WithOptionsSecResolved::new(\n        {\n            let mut with_properties = source.with_properties.clone();\n            let _removed = with_properties.remove(DEBUG_SPLITS_KEY);\n\n            #[cfg(not(debug_assertions))]\n            {\n                if _removed.is_some() {\n                    return Err(ConnectorError::from(anyhow::anyhow!(\n                        \"`debug_splits` is not allowed in release mode\"\n                    )));\n                }\n            }\n\n            with_properties\n        },\n        source.secret_refs.clone(),\n    );\n    let mut properties = ConnectorProperties::extract(options_with_secret, true)?;\n    properties.init_from_pb_source(source);\n    Ok(properties)\n}\n\n/// Used to create a new [`ConnectorSourceWorkerHandle`] for a new source.\n///\n/// It will call [`ConnectorSourceWorker::tick()`] to fetch split metadata once before returning.\npub async fn create_source_worker(","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/stream/source_manager/worker.rs#L83-L119","documentation":"extract_prop_from_new_source strips the `debug_splits` property from source with_properties; in release builds (cfg(not(debug_assertions))) supplying it is a hard error. `debug_splits` is a developer-only knob to force specific splits in debug testing.","triggerScenarios":"CREATE SOURCE ... WITH (debug_splits = '...') (or ALTER SOURCE adding it) against a release-mode RisingWave binary.","commonSituations":"Copying a WITH clause from a dev/nightly test setup into a production release deployment; reproducing a split assignment bug on prod by accident.","solutions":["Remove the `debug_splits` property from the source's WITH options","Use a debug build (debug_assertions enabled) if you genuinely need forced splits","ALTER the source to drop the property, then retry the operation"],"exampleFix":"-- before\nCREATE SOURCE s (...) WITH (connector = 'kafka', debug_splits = '...');\n-- after\nCREATE SOURCE s (...) WITH (connector = 'kafka');","handlingStrategy":"validation","validationCode":"-- check the WITH clause before creating a source in release mode\nSELECT * FROM rw_catalog.rw_sources WHERE name = 's'; -- inspect properties for debug_splits","typeGuard":null,"tryCatchPattern":"match create_source(...) {\n    Err(e) if e.to_string().contains(\"debug_splits\") => {\n        // strip the property and retry\n    }\n    r => r?,\n}","preventionTips":["Never copy debug_splits from dev test fixtures into prod DDL","Lint DDL scripts for debug-only WITH options","Use dev builds only in dev environments"],"tags":["rust","meta","debug-splits","source"],"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"}