{"record":{"id":"10ede3ac038d761d","repo":"risingwavelabs/risingwave","slug":"invalid-backfill-num-rows-per-split-must-be-great","errorCode":null,"errorMessage":"invalid backfill_num_rows_per_split, must be greater than 0","messagePattern":"invalid backfill_num_rows_per_split, must be greater than 0","errorType":"validation","errorClass":"ConnectorError","httpStatus":null,"severity":"error","filePath":"src/connector/src/source/cdc/external/postgres.rs","lineNumber":190,"sourceCode":"        Ok(CdcOffset::Postgres(pg_offset))\n    }\n\n    fn snapshot_read(\n        &self,\n        table_name: SchemaTableName,\n        start_pk: Option<OwnedRow>,\n        primary_keys: Vec<String>,\n        limit: u32,\n    ) -> BoxStream<'_, ConnectorResult<OwnedRow>> {\n        assert_eq!(table_name, self.schema_table_name);\n        self.snapshot_read_inner(table_name, start_pk, primary_keys, limit)\n    }\n\n    #[try_stream(boxed, ok = CdcTableSnapshotSplit, error = ConnectorError)]\n    async fn get_parallel_cdc_splits(&self, options: CdcTableSnapshotSplitOption) {\n        let backfill_num_rows_per_split = options.backfill_num_rows_per_split;\n        if backfill_num_rows_per_split == 0 {\n            return Err(anyhow::anyhow!(\n                \"invalid backfill_num_rows_per_split, must be greater than 0\"\n            )\n            .into());\n        }\n        if options.backfill_split_pk_column_index as usize >= self.pk_indices.len() {\n            return Err(anyhow::anyhow!(format!(\n                \"invalid backfill_split_pk_column_index {}, out of bound\",\n                options.backfill_split_pk_column_index\n            ))\n            .into());\n        }\n        let split_column = self.split_column(&options);\n        let row_stream = if options.backfill_as_even_splits\n            && is_supported_even_split_data_type(&split_column.data_type)\n        {\n            // For certain types, use evenly-sized partition to optimize performance.\n            tracing::info!(?self.schema_table_name, ?self.rw_schema, ?self.pk_indices, ?split_column, \"Get parallel cdc table snapshot even splits.\");\n            self.as_even_splits(options)","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/cdc/external/postgres.rs#L172-L208","documentation":"The PostgreSQL CDC splitter validates `backfill_num_rows_per_split` before generating snapshot splits. A value of 0 would cause infinite/zero-size splits, so the connector rejects it up front with this error. It is an input validation error on the split-generation options.","triggerScenarios":"Calling `get_parallel_cdc_splits` with `CdcTableSnapshotSplitOption.backfill_num_rows_per_split == 0` — typically from source property `backfill_num_rows_per_split` set to 0 or defaulting incorrectly.","commonSituations":"Typos in CDC source `WITH` options; setting the option to 0 expecting 'unlimited'; migrating configs between versions where the default changed; programmatic construction of split options passing 0.","solutions":["Set `backfill_num_rows_per_split` to a positive integer appropriate for table size (e.g. 8096 or 100000).","Remove the option entirely so the connector default is used, if a default exists.","Check the source's `WITH` clause / properties file for a stray 0 value.","Review release notes if the option's semantics/default changed after an upgrade."],"exampleFix":"// before\nCREATE TABLE t (...) WITH (connector = 'postgres-cdc', backfill_num_rows_per_split = '0');\n// after\nCREATE TABLE t (...) WITH (connector = 'postgres-cdc', backfill_num_rows_per_split = '8096');","handlingStrategy":"validation","validationCode":"// Validate the option before building the source\nlet rows_per_split: i32 = props.get(\"backfill_num_rows_per_split\").parse()?;\nif rows_per_split <= 0 { return Err(\"backfill_num_rows_per_split must be > 0\"); }","typeGuard":null,"tryCatchPattern":"match get_parallel_cdc_splits(opts).await {\n    Err(e) if e.to_string().contains(\"backfill_num_rows_per_split\") => {\n        // correct the option and resubmit\n    },\n    r => r?,\n}","preventionTips":["Use positive defaults (e.g. 8096) in config templates.","Lint CDC source WITH options before submission.","Never set row-count knobs to 0 to mean 'unlimited'."],"tags":["cdc","postgres","configuration","validation"],"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"}