开发者社区> 问答> 正文

adapter全量同步大数据量情况下出现deadlock

环境信息

canal adapter version 1.15 mysql version 8.0

问题描述

使用adatper同步大数据量(100w)失败,提示如下:

2022-03-06 17:44:49.110 [pool-8-thread-29] ERROR c.a.otter.canal.client.adapter.rdb.service.RdbEtlService - etl failed! ==>Deadlock found when trying to get lock; try restarting transaction com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; try restarting transaction at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:123) ~[mysql-connector-java-8.0.21.jar:8.0.21] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.21.jar:8.0.21] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.21.jar:8.0.21] at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) ~[mysql-connector-java-8.0.21.jar:8.0.21] at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370) ~[mysql-connector-java-8.0.21.jar:8.0.21] at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbEtlService.lambda$executeSqlImport$2(RdbEtlService.java:140) ~[na:na] at com.alibaba.otter.canal.client.adapter.support.Util.sqlRS(Util.java:62) ~[client-adapter.common-1.1.5-SNAPSHOT.jar:na] at com.alibaba.otter.canal.client.adapter.rdb.service.RdbEtlService.executeSqlImport(RdbEtlService.java:79) ~[na:na] at com.alibaba.otter.canal.client.adapter.support.AbstractEtlService.lambda$importData$1(AbstractEtlService.java:91) ~[client-adapter.common-1.1.5-SNAPSHOT.jar:na] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_311] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_311] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_311] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_311]

原提问者GitHub用户

展开
收起
后端老大 2023-04-26 16:28:12 156 0
1 条回答
写回答
取消 提交回答
  • 看一下数据库的隔离级别,默认rr,调整成rc

    原回答者GitHub用户yhtomcat

    2023-04-26 18:48:26
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Data+AI时代大数据平台应该如何建设 立即下载
大数据AI一体化的解读 立即下载
极氪大数据 Serverless 应用实践 立即下载