Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequence support is incomplete #4559

Closed
overvenus opened this issue Feb 10, 2022 · 2 comments · Fixed by #10203
Closed

Sequence support is incomplete #4559

overvenus opened this issue Feb 10, 2022 · 2 comments · Fixed by #10203
Assignees
Labels
area/ticdc Issues or PRs related to TiCDC. component/ddl DDL component. MariaDB This issue is found with MariaDB upstream subject/new-feature Denotes an issue or pull request adding a new feature. type/feature Issues about a new feature

Comments

@overvenus
Copy link
Member

Is your feature request related to a problem?

Sequence support is incomplete in TiCDC.

The current capability of TiCDC:

The DDL operation CREATE SEQUENCE and the SEQUENCE function in TiDB. When the upstream TiDB uses SEQUENCE, TiCDC ignores SEQUENCE DDL operations/functions performed upstream. However, DML operations using SEQUENCE functions can be correctly replicated.

2022/02/10, https://docs.pingcap.com/tidb/stable/ticdc-overview#unsupported-scenarios

Besides, there are two flaws we found,

  1. TiCDC have no idea about how to deal with DDLs below:
    CREATE SEQUENCE `SEQ1` start with 1 minvalue 1 maxvalue 999999999999999 increment by 1 nocache cycle;
    CREATE TABLE t(k int not null, a int default next value for SEQ1, PRIMARY KEY (k));
  2. TiCDC filters all SEQUENCE DDL, it means we lost SEQUENCE even if downstream is TiDB. We lose data in TiDB disaster recovery scenario.

Describe the feature you'd like

Support sequence feature completely when downstream is TiDB, and disable sequence completely when downstream is MySQL.

Describe alternatives you've considered

No response

Teachability, Documentation, Adoption, Migration Strategy

No response

@overvenus overvenus added component/ddl DDL component. subject/new-feature Denotes an issue or pull request adding a new feature. area/ticdc Issues or PRs related to TiCDC. labels Feb 10, 2022
@overvenus overvenus changed the title Sequence support in incomplete Sequence support is incomplete Feb 11, 2022
@dveeden
Copy link
Contributor

dveeden commented Nov 27, 2023

Note that this also affects MariaDB-to-TiDB.

Example:

 "Message": "startLocation: [position: (mariadb-binlog.000001, 882), gtid-set: 0-1-3], endLocation: [position: (mariadb-binlog.000001, 1006), gtid-set: 0-1-4], origin SQL: [CREATE SEQUENCE s START WITH 100 INCREMENT BY 10]: unknown type ddl \u0026{ddlNode:{stmtNode:{node:{utf8Text: enc:0x6921ce0 once:0xc000f00360 text:CREATE SEQUENCE s START WITH 100 INCREMENT BY 10 offset:0}}} IfNotExists:false Name:0xc002510410 SeqOptions:[0xc000f00340 0xc000f00350] TblOptions:[]}",

@lance6716 lance6716 added type/feature Issues about a new feature MariaDB This issue is found with MariaDB upstream labels Dec 1, 2023
@dveeden
Copy link
Contributor

dveeden commented Dec 1, 2023

@lance6716 @overvenus
I noticed this issue was originally about TiCDC and what I reported was about DM. Should I create a separate issue for DM or can we continue with this combined issue?

@asddongmen asddongmen self-assigned this Jan 20, 2024
ti-chi-bot bot pushed a commit that referenced this issue Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ticdc Issues or PRs related to TiCDC. component/ddl DDL component. MariaDB This issue is found with MariaDB upstream subject/new-feature Denotes an issue or pull request adding a new feature. type/feature Issues about a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants