risingwavelabs/risingwave · critical

All valid CDC connectors should have returned by now

Error message

All valid CDC connectors should have returned by now

What it means

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).

Source

Thrown at src/frontend/src/handler/create_table.rs:1110

                // Insert schema and table names into connector properties
                with_options.insert(SCHEMA_NAME_KEY.into(), schema_name.into());
                with_options.insert(TABLE_NAME_KEY.into(), table_name.into());

                // Normalize external_table_name to 'schema.table' format
                // This ensures consistency with extract_table_name() in message.rs
                let normalized_external_table_name = format!("{}.{}", schema_name, table_name);
                return Ok((with_options, normalized_external_table_name));
            }
            _ => {
                return Err(RwError::from(anyhow!(
                    "connector {} is not supported for cdc table",
                    connector
                )));
            }
        };
    }
    unreachable!("All valid CDC connectors should have returned by now")
}

/// Parse the schema/table name from the CDC `TABLE` clause.
///
/// Column names do not need the same parsing here: wildcard schema derivation reads
/// them from PostgreSQL catalogs after the exact table has been identified.
fn parse_postgres_cdc_external_table_name(external_table_name: &str) -> Result<(String, String)> {
    let mut parts = vec![];
    let mut current = String::new();
    let mut chars = external_table_name.chars().peekable();
    let mut in_quote = false;
    let mut just_closed_quote = false;

    while let Some(ch) = chars.next() {
        if in_quote {
            if ch == '"' {
                if chars.peek() == Some(&'"') {
                    current.push('"');

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Inspect the match statement in derive_with_options_for_cdc_table; ensure every CDC connector arm returns Ok or Err.
  2. Move the newly added connector into the matched arms with a proper normalization branch.
  3. 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).
  4. As a workaround, avoid creating the table until the patched build is fixed.

Example fix

// before
_ => { /* new connector, no return */ }
unreachable!("All valid CDC connectors should have returned by now")
// after
Some("my-cdc") => { ...normalize and return Ok((with_options, name)) }
unreachable!("All valid CDC connectors should have returned by now")
Defensive patterns

Strategy: try-catch

Try / catch

// Not user-triggerable; wrap cluster operations and treat panics as bugs
match result {
    Err(e) if e.to_string().contains("All valid CDC connectors") => report_bug_with_backtrace(e),
    _ => {},
}

Prevention

When it happens

Trigger: 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.

Common situations: Custom RisingWave builds or patches adding a CDC connector; downstream forks with modified connector handling. Not triggerable by SQL input from a stock build.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/0d6b9fc1d8b14c09. Report an issue: GitHub.