【报错详情】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及以上版本即可,新版本默认使用无锁算法,不需要申请锁。