{"record":{"id":"0d6b9fc1d8b14c09","repo":"risingwavelabs/risingwave","slug":"all-valid-cdc-connectors-should-have-returned-by-n","errorCode":null,"errorMessage":"All valid CDC connectors should have returned by now","messagePattern":"All valid CDC connectors should have returned by now","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/frontend/src/handler/create_table.rs","lineNumber":1110,"sourceCode":"\n                // Insert schema and table names into connector properties\n                with_options.insert(SCHEMA_NAME_KEY.into(), schema_name.into());\n                with_options.insert(TABLE_NAME_KEY.into(), table_name.into());\n\n                // Normalize external_table_name to 'schema.table' format\n                // This ensures consistency with extract_table_name() in message.rs\n                let normalized_external_table_name = format!(\"{}.{}\", schema_name, table_name);\n                return Ok((with_options, normalized_external_table_name));\n            }\n            _ => {\n                return Err(RwError::from(anyhow!(\n                    \"connector {} is not supported for cdc table\",\n                    connector\n                )));\n            }\n        };\n    }\n    unreachable!(\"All valid CDC connectors should have returned by now\")\n}\n\n/// Parse the schema/table name from the CDC `TABLE` clause.\n///\n/// Column names do not need the same parsing here: wildcard schema derivation reads\n/// them from PostgreSQL catalogs after the exact table has been identified.\nfn parse_postgres_cdc_external_table_name(external_table_name: &str) -> Result<(String, String)> {\n    let mut parts = vec![];\n    let mut current = String::new();\n    let mut chars = external_table_name.chars().peekable();\n    let mut in_quote = false;\n    let mut just_closed_quote = false;\n\n    while let Some(ch) = chars.next() {\n        if in_quote {\n            if ch == '\"' {\n                if chars.peek() == Some(&'\"') {\n                    current.push('\"');","sourceCodeStart":1092,"sourceCodeEnd":1128,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/handler/create_table.rs#L1092-L1128","documentation":"A defensive `unreachable!()` panic after the connector match in `derive_with_options_for_cdc_table`. The match is exhaustive for known CDC connectors and every other arm returns an error, so this line should never execute; hitting it means an internal invariant was violated (a new CDC connector arm was added without returning, or the match logic changed).","triggerScenarios":"Only reachable via a code change/bug: a new CDC connector variant added to the match that falls through instead of returning, or a refactoring that alters the return flow of derive_with_options_for_cdc_table.","commonSituations":"Custom RisingWave builds or patches adding a CDC connector; downstream forks with modified connector handling. Not triggerable by SQL input from a stock build.","solutions":["Inspect the match statement in derive_with_options_for_cdc_table; ensure every CDC connector arm returns Ok or Err.","Move the newly added connector into the matched arms with a proper normalization branch.","Report a bug with the Rust backtrace if seen on an unmodified build (it indicates the 'connector not supported' arm failed to catch a value).","As a workaround, avoid creating the table until the patched build is fixed."],"exampleFix":"// before\n_ => { /* new connector, no return */ }\nunreachable!(\"All valid CDC connectors should have returned by now\")\n// after\nSome(\"my-cdc\") => { ...normalize and return Ok((with_options, name)) }\nunreachable!(\"All valid CDC connectors should have returned by now\")","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Not user-triggerable; wrap cluster operations and treat panics as bugs\nmatch result {\n    Err(e) if e.to_string().contains(\"All valid CDC connectors\") => report_bug_with_backtrace(e),\n    _ => {},\n}","preventionTips":["When forking/patching RisingWave, ensure every new CDC connector arm in derive_with_options_for_cdc_table returns explicitly.","Run clippy/tests after modifying connector matching code.","Include Rust backtraces (RUST_BACKTRACE=1) in bug reports for this panic."],"tags":["cdc","unreachable","internal-invariant","panic"],"backgroundTag":"internal-invariant-violation","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"}