{"record":{"id":"e9e2f3a104789236","repo":"risingwavelabs/risingwave","slug":"missing-slot-name-in-cdc-properties","errorCode":null,"errorMessage":"missing `slot.name` in CDC properties","messagePattern":"missing `slot\\.name` in CDC properties","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/cdc/enumerator/mod.rs","lineNumber":244,"sourceCode":"            }\n            None => {\n                tracing::warn!(\n                    \"no replication slot was found while querying LSNs for source {}\",\n                    self.source_id\n                );\n            }\n        };\n        Ok(())\n    }\n\n    /// Query LSNs from PostgreSQL, return (`confirmed_flush_lsn`, `upstream_max_lsn`, `slot_name`).\n    async fn query_postgres_lsns(&self) -> ConnectorResult<Option<(Option<u64>, u64, String)>> {\n        let pg_conn = pg_connection_config_from_properties(&self.properties)?;\n\n        let slot_name = self\n            .properties\n            .get(\"slot.name\")\n            .ok_or_else(|| anyhow::anyhow!(\"missing `slot.name` in CDC properties\"))?;\n\n        // No TCP keepalive for CDC enumerator\n        let application_name = format!(\"risingwave-postgres-source-enumerator-{}\", self.source_id);\n        let client = create_pg_client(&pg_conn, None, Some(&application_name))\n            .await\n            .context(\"failed to create the PostgreSQL client\")?;\n\n        let query = \"SELECT confirmed_flush_lsn, pg_current_wal_lsn() \\\n            FROM pg_replication_slots WHERE slot_name = $1\";\n        let row = client\n            .query_opt(query, &[&slot_name])\n            .await\n            .context(\"failed to query PostgreSQL LSNs\")?;\n        match row {\n            Some(row) => {\n                let confirmed_flush_lsn: Option<PgLsn> = row.get(0);\n                let upstream_max_lsn: PgLsn = row.get(1);\n                Ok(Some((","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/cdc/enumerator/mod.rs#L226-L262","documentation":"CdcSplitEnumerator::query_postgres_lsns connects to the upstream PostgreSQL to read slot LSNs (used to monitor confirmed_flush_lsn for progress). It requires the CDC properties to contain `slot.name`; without it, the slot to query is unknown and this error is thrown.","triggerScenarios":"Calling query_postgres_lsns (via monitor_postgres_confirmed_flush_lsn) on a Postgres CDC source whose properties map lacks the 'slot.name' key — e.g. the source was created without slot.name or with a misspelled key like slotname.","commonSituations":"Postgres CDC source created without slot.name option; renaming option keys between versions; manually constructed properties maps.","solutions":["Add slot.name='<slot>' to the CDC source WITH clause (or recreate the source with it)","Check for misspellings such as slotname / slot_name — the key must be exactly 'slot.name'","Drop and recreate the source if persisted metadata is missing the key"],"exampleFix":"// before\nWITH (connector='cdc', hostname='pg', database='mydb', ...)\n// after\nWITH (connector='cdc', hostname='pg', database='mydb', slot.name='rw_slot_1', ...)","handlingStrategy":"validation","validationCode":"if !cdc_props.contains_key(\"slot.name\") {\n    return Err(anyhow!(\"CDC properties require slot.name, e.g. slot.name='rw_slot_1'\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set slot.name when creating Postgres CDC sources","Use the exact key spelling 'slot.name' (dot, not underscore)","Validate CDC property keys against the documented schema before creation"],"tags":["cdc","postgres","config","lsn"],"backgroundTag":"missing-required-config-field","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"}