Skip to content

Lightning ResolveDuplicateRows casue checksum mismatch #40657

@sleepymole

Description

@sleepymole

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Table schema:

CREATE TABLE `t` (
     `id` int(11) NOT NULL,
     `name` varchar(255) DEFAULT NULL,
     PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
     UNIQUE KEY `uni_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

Enable duplicate-resolution

[tikv-importer]
backend = "local"
duplicate-resolution = "remove"

Use tidb-lightning to import data twice.

For the first time, import data with unique key conflicts.

id,name
1,"aaa01"
2,"aaa02"
3,"aaa03"
4,"aaa04"
5,"aaa04"

Conflict errors are detected as expected.

Import Data Error Summary: 
+---+---------------------+-------------+------------------------------------- ~
| # | ERROR TYPE          | ERROR COUNT | ERROR DATA TABLE                     ~
+---+---------------------+-------------+------------------------------------- ~
| 1 | Unique Key Conflict |          2 | `lightning_task_info`.`conflict_erro ~
+---+---------------------+-------------+------------------------------------- ~

For the second time, truncate the table and import data with no unique key conflicts.

id,name
1,"aaa01"
2,"aaa02"
3,"aaa03"
4,"aaa04"
5,"aaa05"

No conflict error is detected. But checksum mismatch is reported.

2. What did you expect to see? (Required)

After the table is truncated, import should complete without any error.

3. What did you see instead (Required)

checksum mismatch error is reported.

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-5.4This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.component/lightningThis issue is related to Lightning of TiDB.severity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions