How to Configure TiCDC to Ignore Primary Key Conflicts When Synchronizing Data

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

Original topic: TiCDC同步数据如何配置忽略主键冲突

| username: Hacker_Dvkc9hRC

In the process of using TiCDC for primary-secondary cluster replication, for tables without primary keys, how can you configure to skip primary key conflicts without considering data consistency, allowing replication to continue and synchronization to remain normal?

| username: Jellybean | Original post link

CDC internally rewrites SQL as a replace operation before synchronizing it downstream, so writing to downstream should theoretically be an idempotent operation.

What specific problem did you encounter?

| username: TIDB-Learner | Original post link

Yes, there may be data inconsistency. Check the official documentation. :face_with_hand_over_mouth:

| username: tidb菜鸟一只 | Original post link

What do you mean? How can there be a primary key conflict in a table without a primary key?

| username: Daniel-W | Original post link

You mean there are tables without primary keys, and when creating a changefeed, there will be a prompt indicating the existence of tables without primary keys? If consistency is not a concern, you can directly confirm and skip it. :face_with_open_eyes_and_hand_over_mouth:

| username: TiDBer_rvITcue9 | Original post link

Support skipping

| username: zhang_2023 | Original post link


| username: 洪七表哥 | Original post link

Can be skipped.

| username: zhaokede | Original post link

After skipping, data verification becomes very troublesome.

| username: Soysauce520 | Original post link

Tables without primary keys or unique keys will not be synchronized by default.

| username: TiDBer_HErMeXDz | Original post link

It can be understood as idempotent.