Skip to content

CDC should handle RENAME TABLE a TO tmp, b TO a, tmp TO b; #12955

Closed

Description

@harry-hao

What did you do?

  1. Setup cluster X and Y, create capture feed X->Y
  2. Create two tables A and B then rename them with:
CREATE TABLE a (id INT PRIMARY KEY, v INT);
CREATE TABLE b LIKE a;
...
RENAME TABLE a TO tmp, b TO a, tmp TO b;
  1. Got error in cdc.log: "[CDC:ErrSnapshotTableNotFound]table 114 not found in schema snapshot"

What did you expect to see?

There should be no error, and two table swap their names.

What did you see instead?

[CDC:ErrSnapshotTableNotFound]table 114 not found in schema snapshot

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

mysql> SELECT tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                      |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v9.0.0-beta.1
Edition: Community
Git Commit Hash: 7aff918dcbfa6facf2adef9ade9961c40f217421
Git Branch: HEAD
UTC Build Time: 2025-03-24 09:11:37
GoVersion: go1.23.7
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)

Upstream TiKV version (execute tikv-server --version):

TiKV
Release Version:   8.5.0
Edition:           Community
Git Commit Hash:   a2c58c94f89cbb410e66d8f85c236308d6fc64f0
Git Commit Branch: HEAD
UTC Build Time:    2024-12-18 03:33:02
Rust Version:      rustc 1.77.0-nightly (89e2160c4 2023-12-27)
Enable Features:   memory-engine pprof-fp jemalloc sse test-engine-kv-rocksdb test-engine-raft-raft-engine trace-async-tasks openssl-vendored
Profile:           dist_release

TiCDC version (execute cdc version):

Release Version: v9.0.0-beta.2.pre-156-g62d77a345-dirty
Git Commit Hash: 62d77a34520b8164004a92eaf72e9d728549d978
Git Branch: HEAD
UTC Build Time: 2026-11-07 07:48:30
Go Version: go1.27.3
Failpoint Build: false

Activity

  1. added
    type/bug
    area/ticdc
    on Nov 7, 2026
  2. added
    contribution
    on Nov 7, 2026
  3. ti-chi-bot commented on Nov 7, 2026

    @ti-chi-bot
    Contributor

    Welcome @harry-hao! It looks like this is your first issue to pingcap/tiflow 🎉

  4. added
    first-time-contributor
    on Nov 7, 2026
  5. harry-hao commented on Nov 7, 2026

    @harry-hao
    Author

    This cyclic renames issue seems already reported in #12286, and #12287 have introduced ignore-txn-start-ts to discard it.
    The #12956 is to replicate it successfully.

  6. wk989898 commented on Nov 9, 2026

    @wk989898
    Collaborator

    Please use the new architecture that supports swapping table names , and the old architecture is not planned to be fixed.
    Related issue: pingcap/ticdc#1734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ticdccontributionfirst-time-contributortype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions