DM Synchronization Issue: Duplicate Primary Key Code=26005

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

Original topic: dm同步问题主键重复code=26005

| username: Jjjjayson_zeng

Error when starting the task, hoping to skip primary key validation.

| username: hey-hoho | Original post link

For any migration mode, the pre-check will include the following general check items:

  • Compatibility of the upstream MySQL table structure
    • Check whether the upstream table has set foreign keys. TiDB does not support foreign keys, and if the upstream table has set foreign keys, a warning will be returned.
    • (Mandatory) Check for compatibility differences in character sets. For details, see Character Sets Supported by TiDB.
    • (Mandatory) Check whether there are primary key or unique key constraints in the upstream table (introduced from version v1.0.7).

You can set the ignore check items parameter to skip table structure validation:

ignore-checking-items: ["table_schema"]

In general, pre-check items are used to identify potential risks in the environment in advance, and it is not recommended to ignore them.

Reference: TiDB Data Migration 任务前置检查 | PingCAP 文档中心

| username: Jjjjayson_zeng | Original post link

I tried your solution, but it didn’t work. I’m not sure if I placed it incorrectly. I used a script to create it, so I’ll try creating it manually.

| username: xiaohetao | Original post link

But it didn’t work. I don’t know if I placed it incorrectly.

Here is a prompt. Follow “hey-hoho’s” advice to check the configuration and see if it triggered DM’s limitations.

| username: xiaohetao | Original post link

Are the versions of TiDB, MySQL, and DM all compatible?

| username: Jjjjayson_zeng | Original post link

Thank you for the response. Actually, we are not compatible. Some leaders previously arranged a wave of MySQL upgrades, so there are always writing issues, which is very frustrating.

| username: Jjjjayson_zeng | Original post link

It works now. Recreating the task confirmed that it was indeed an issue with the DM mechanism.

| username: xiaohetao | Original post link

:+1::+1::+1:

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.