pingcap / pingcap/ticdc

routing: incorrect rule matching and CREATE VIEW rewriting

Open
#6,264 0 comments 0 reactions 1 assignee View on GitHub

@3AceShowHand is already working on this.

Since Sep 15, 2026.

component/sink severity/moderate type/bug
Dominant language
Go
Stars
56
Forks
63
Avg merge
2d 20h
Merged PRs (30d)
34

Description

What did you do?

Used table routing in TiCDC's new architecture. The following configurations and DDLs expose independent problems:

  • Set changefeed case-sensitive = true and route Sales.* while the source table is sales.orders.
  • Create a changefeed with an invalid route matcher ([) and no source tables.
  • Place a table-only route for sales.orders before an MQ rule for sales.* with topic sales-events and partition ts.
  • Use {schema}_{table} with source schema db{table} and table orders.
  • Route test.* to dst.{table}_r and create views using SELECT t.* FROM t or WITH c AS (SELECT id FROM t) SELECT id FROM c.
What did you expect to see?

Routing should honor the changefeed configuration, validate matchers regardless of table count, preserve MQ dispatch behavior and literal source names, and preserve view query results.

What did you see instead?
  • The dispatcher uses the sink-level case-sensitivity field, producing different routes from API validation and the maintainer.
  • Invalid matchers pass validation when the table set is empty.
  • Table-only routing rules shadow MQ rules, changing the topic and partition selection.
  • Placeholder substitution processes inserted source text again: db{table}_orders becomes dborders_orders.
  • Qualified wildcards retain the old table name. CTE references are renamed as physical tables, such as dst.c_r, causing view creation failures or incorrect results when that physical table exists.
Scope and likelihood

These issues require specific configuration combinations, unusual identifiers, or particular view definitions, so they are expected to be uncommon in typical production use. This assessment is based on the trigger conditions, not measured incident rates. When triggered, they can still cause incorrect routing or interrupt replication.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.