Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: mysql 数据通过DM同步到下游TIDB,sync状态出现Duplicate entry ‘xxx’ for key ‘PRIMARY’"
MySQL data is synchronized to downstream TiDB V5.4.1 through DM, and the sync status shows “Duplicate entry ‘xxx’ for key ‘PRIMARY’”.
Table structure:
CREATE TABLE `t_order_local_price` (
`o_id` int(11) NOT NULL,
`olp_curr` varchar(5) NOT NULL,
`olp_curr_price` decimal(11,3) NOT NULL,
`olp_curr_price_usd` decimal(11,3) NOT NULL,
PRIMARY KEY (`o_id`),
KEY `olp_curr` (`olp_curr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
When the “Duplicate entry ‘xxx’ for key ‘PRIMARY’” error occurs, I only find one record in the upstream source data, but it already exists in the downstream. Is this a bug in DM? How can I resolve it? The table is also very small.
[Attachment]
Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing
cdc version
/tikv-server --version
.