TiDB TiCDC 6.1.1

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TIDB TICDC 6.1.1

| username: Zhou_Ming

The following is a table I created under TiDB, and when creating a changefeed, it says that the table cannot be replicated. What is the issue with the DDL? The table has a unique index.

CREATE TABLE `db2rp` (
  `subsystem` char(6) NOT NULL,
  `start_date` char(10) NOT NULL,
  `start_time` char(8) NOT NULL,
  `corrname` char(20) NOT NULL,
  `occurrence` bigint(20) DEFAULT NULL,
  `db2cl2time` decimal(20,6) DEFAULT NULL,
  `db2cl2cpu` decimal(20,6) DEFAULT NULL,
  `db2cl2cpuse` decimal(20,6) DEFAULT NULL,
  `dmlall` bigint(20) DEFAULT NULL,
  `pkcl7cputime` decimal(20,6) DEFAULT NULL,
  `pkcl7cputimese` decimal(20,6) DEFAULT NULL,
  `pkcl7time` decimal(20,6) DEFAULT NULL,
  `pkgcl8time` decimal(20,6) DEFAULT NULL,
  `pkgcollid` char(10) DEFAULT NULL,
  `pkgcorrren` bigint(20) DEFAULT NULL,
  `pkgname` char(20) DEFAULT NULL,
  KEY `start_date` (`start_date`,`start_time`,`subsystem`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
| username: weixiaobing | Original post link

Synchronization Limitations

When using TiCDC for synchronization, please be aware of the following related restrictions and unsupported scenarios.

Requirements for Valid Indexes

TiCDC can only synchronize tables that have at least one valid index. The definition of a valid index is as follows:

  • A primary key (PRIMARY KEY) is considered a valid index.
  • A unique index (UNIQUE INDEX) is considered a valid index if it meets the following conditions:
    • Each column in the index is explicitly defined as non-null (NOT NULL) in the table structure.
    • The index does not contain virtual generated columns (VIRTUAL GENERATED COLUMNS).

Starting from version 4.0.8, TiCDC allows synchronization of tables without valid indexes by modifying the task configuration, but the guarantee of data consistency is weakened. For specific usage methods and precautions, refer to Synchronizing Tables Without Valid Indexes.

| username: Zhou_Ming | Original post link

My index column is also non-null, why can’t it be synchronized?

| username: h5n1 | Original post link

Please share the specific error message.

| username: Zhou_Ming | Original post link

[WARN] Some tables are not eligible to replicate, model.TableName{model.TableName{Schema:“zm”, Table:“db2rp”, TableID:0, IsPartition:false}}
Could you agree to ignore those tables, and continue to replicate [Y/N]

| username: h5n1 | Original post link

Refer to the post above.

| username: weixiaobing | Original post link

Your index is not a unique index.