TiCDC reports an error "some tables are not eligible to replicate([kiki.sele_demo]), if you want to ignore these tables, please set ignore_ineligible_table" when creating a task connection

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

Original topic: ticdc在连接创建任务的时候,创建不成功报错some tables are not eligible to replicate([kiki.sele_demo]), if you want to ignore these tables, please set ignore_ineligible_table

| username: TiDBer_8xv3YpMO

There was no problem when creating tasks before, but today there was an issue when creating tasks.

| username: Billmay表妹 | Original post link

Some tables do not meet the replication conditions ([kiki.sele_demo]). If you want to ignore these tables, please set ignore_ineligible_table.

| username: TiDBer_8xv3YpMO | Original post link

Where should I modify the source code for directly deploying ticdc?

| username: dba-kit | Original post link

It should be caused by the lack of a primary key in the kiki.sele_demo table. TiCDC does not support synchronizing tables without a primary key.

| username: TiDBer_8xv3YpMO | Original post link

So where should I make the changes? I am using Go for deployment.

| username: dba-kit | Original post link

You don’t need to modify the TiCDC source code for this. Just add ignore_ineligible_table=true to the URL when creating the changefeed. However, remember that in this case, CDC will skip changes to the kiki.sele_demo table.

| username: TiDBer_8xv3YpMO | Original post link

Can this method avoid ignoring these tables?

| username: 小王同学Plus | Original post link

To synchronize tables without effective indexes, you can configure two parameters, but there are some precautions that need attention. You can refer to the official documentation above.

| username: ljluestc | Original post link

Here is an example configuration file with the ignore_ineligible_table option set:

{
    "changefeed-id": "example-changefeed",
    "sink-uri": "mysql://user:password@localhost:3306/test",
    "enable-old-value": true,
    "start-ts": 425091232384233219,
    "target-ts": 425091232384233219,
    "filter": {
        "rules": [
            {
                "pattern": "test.*",
                "ignore-txn-start-ts": 0,
                "action": "include"
            }
        ]
    },
    "config": {
        "case-sensitive": false,
        "enable-old-value": true,
        "dispatch-safety-checker": true,
        "filter": {
            "rules": [
                {
                    "pattern": "kiki.sele_demo",
                    "ignore-txn-start-ts": 0,
                    "action": "ignore"
                }
            ]
        },
        "mounter": {
            "worker-num": 16
        },
        "cdc": {
            "batch-size": 4096,
            "region-concurrency": 10,
            "enable-old-value": true
        }
    }
}

In the above configuration file, the filter section is used to include all tables in the test database, and the config.filter section is used to ignore the [kiki.sele_demo] table.

Save the configuration file to a location on your system, such as /path/to/config.json, and then use the following command to create the task:
cdc cli --start-task --config /path/to/config.json
This will create a task with the specified configuration and should ignore ineligible tables.