Skip to content

mysql deadlock when replicating table with unique key #1033

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

Closed
ghost opened this issue Nov 16, 2022 · 3 comments
Closed

mysql deadlock when replicating table with unique key #1033

ghost opened this issue Nov 16, 2022 · 3 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Nov 16, 2022

CREATE TABLE a.t13 (id INT(11) AUTO_INCREMENT, c CHAR(20)  DEFAULT 't13',
 CONSTRAINT UNIQUE INDEX (id, c));
2022-11-14T17:37:09.879+0800 [ERROR] extractor: onError: job=ddl_create_table_constraint-migration err="applier error: Error 1213: Deadlock found when trying to get lock; try restarting transaction" hasShutdown=false
@ghost
Copy link
Author

ghost commented Nov 16, 2022

使用简化情况代码测试:

  • 5.7.25 可以复现
  • 5.7.34 无法复现

此处描述了 MySQL 5.7.26 中 deadlock 增多的情况 https://stackoverflow.com/questions/68627347

@ghost ghost added the notes label Nov 16, 2022
@ghost
Copy link
Author

ghost commented Apr 11, 2023

总结

  1. 死锁由MySQL Bug引起. 该MySQL Bug于5.7.26修复.
  2. dtle 将在新版提供“死锁时重试事务”机制, 一定程度上能缓解问题.

@ghost ghost closed this as completed Apr 11, 2023
@ghost ghost added this to the 4.22.12.0 milestone Apr 11, 2023
@ghost
Copy link
Author

ghost commented Apr 11, 2023

ATK-3274

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

0 participants