开发者社区> 问答> 正文

Flink报错Lock wait timeout exceeded; try restarti...

已解决

Flink报错Lock wait timeout exceeded; try restarting transaction

展开
收起
提个问题! 2024-06-08 10:06:45 47 0
1 条回答
写回答
取消 提交回答
  • 开发者社区问答官方账号
    官方回答
    采纳回答
    【报错详情】org.apache.kafka.connect.errors.ConnectException: Lock wait timeout exceeded; try restarting transaction Error code: 1205; SQLSTATE: 40001.
        at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:241)
        at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:218)
        at io.debezium.connector.mysql.SnapshotReader.execute(SnapshotReader.java:857)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1147)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
        at java.lang.Thread.run(Thread.java:834)
    Caused by: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:123)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1200)
        at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:554)
        at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:497)
        at io.debezium.connector.mysql.SnapshotReader.readTableSchema(SnapshotReader.java:888)
        at io.debezium.connector.mysql.SnapshotReader.execute(SnapshotReader.java:550)
        ... 3 more
    【报错原因】
    当MySQL CDC源表不开启增量快照读取时,申请锁时可能发生的超时错误。
    【解决方案】
    升级到VVR 4.0.8及以上版本即可,新版本默认使用无锁算法,不需要申请锁。
    2024-06-08 10:06:47
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Flink CDC Meetup PPT - 龚中强 立即下载
Flink CDC Meetup PPT - 王赫 立即下载
Flink CDC Meetup PPT - 覃立辉 立即下载