Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TiCDC meet error: Duplicate entry xxx for key xxx #10918

Closed
lidezhu opened this issue Apr 17, 2024 · 1 comment · Fixed by #10919
Closed

TiCDC meet error: Duplicate entry xxx for key xxx #10918

lidezhu opened this issue Apr 17, 2024 · 1 comment · Fixed by #10919
Assignees
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. area/ticdc Issues or PRs related to TiCDC. severity/major type/bug The issue is confirmed as a bug.

Comments

@lidezhu
Copy link
Collaborator

lidezhu commented Apr 17, 2024

What did you do?

If the upstream cluster runs a transaction with multiple updates to the pk/uk like the following:

begin;
update t set pk=4 where pk=3;
update t set pk=3 where pk=2;
update t set pk=2 where pk =1;
commit;

This transaction may be split into two transactions inside ticdc:
txn1

update t set pk=4 where pk=3;
update t set pk=3 where pk=2;

txn2

update t set pk=2 where pk =1;

And these two transactions have no order between them, so they may be executed in any order.
If txn2 executes first, it will meet error like Duplicate entry xxx for key xxx;

What did you expect to see?

The transaction can be successfully synced to downstream without error

What did you see instead?

ticdc report error: Duplicate entry xxx for key xxx

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

(paste TiDB cluster version here)

Upstream TiKV version (execute tikv-server --version):

(paste TiKV version here)

TiCDC version (execute cdc version):

(paste TiCDC version here)
@lidezhu lidezhu added type/bug The issue is confirmed as a bug. area/ticdc Issues or PRs related to TiCDC. labels Apr 17, 2024
@lidezhu
Copy link
Collaborator Author

lidezhu commented Apr 17, 2024

/severity major

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. area/ticdc Issues or PRs related to TiCDC. severity/major type/bug The issue is confirmed as a bug.
Projects
Development

Successfully merging a pull request may close this issue.

1 participant