开发者社区 > 云原生 > 中间件 > 正文

seata AT模式数据库死锁应该怎么解决?

1、版本 1.4.2
2、配置
image.png

3、错误详情
io.seata.common.exception.StoreException: Deadlock found when trying to get lock; try restarting transaction
at io.seata.server.storage.db.lock.LockStoreDataBaseDAO.unLock(LockStoreDataBaseDAO.java:269) ~[classes/:na]
at io.seata.server.storage.db.lock.DataBaseLocker.releaseLock(DataBaseLocker.java:103) ~[classes/:na]
at io.seata.server.storage.db.lock.DataBaseLockManager.releaseGlobalSessionLock(DataBaseLockManager.java:79) ~[classes/:na]
at io.seata.server.session.GlobalSession.clean(GlobalSession.java:230) [classes/:na]
at io.seata.server.session.GlobalSession.closeAndClean(GlobalSession.java:243) [classes/:na]
at io.seata.server.coordinator.DefaultCore.lambda$commit$0(DefaultCore.java:154) [classes/:na]
at io.seata.server.storage.db.session.DataBaseSessionManager.lockAndExecute(DataBaseSessionManager.java:194) ~[classes/:na]
at io.seata.server.session.SessionHolder.lockAndExecute(SessionHolder.java:331) ~[classes/:na]
at io.seata.server.coordinator.DefaultCore.commit(DefaultCore.java:152) [classes/:na]
at io.seata.server.coordinator.DefaultCoordinator.doGlobalCommit(DefaultCoordinator.java:170) ~[classes/:na]
at io.seata.server.AbstractTCInboundHandler$2.execute(AbstractTCInboundHandler.java:95) ~[classes/:na]
at io.seata.server.AbstractTCInboundHandler$2.execute(AbstractTCInboundHandler.java:90) ~[classes/:na]
at io.seata.core.exception.AbstractExceptionHandler.exceptionHandleTemplate(AbstractExceptionHandler.java:124) ~[seata-core-1.4.2.jar:na]
at io.seata.server.AbstractTCInboundHandler.handle(AbstractTCInboundHandler.java:90) ~[classes/:na]
at io.seata.core.protocol.transaction.GlobalCommitRequest.handle(GlobalCommitRequest.java:34) ~[seata-core-1.4.2.jar:na]
at io.seata.server.coordinator.DefaultCoordinator.onRequest(DefaultCoordinator.java:473) ~[classes/:na]
at io.seata.core.rpc.processor.server.ServerOnRequestProcessor.onRequestMessage(ServerOnRequestProcessor.java:116) ~[seata-core-1.4.2.jar:na]
at io.seata.core.rpc.processor.server.ServerOnRequestProcessor.process(ServerOnRequestProcessor.java:77) ~[seata-core-1.4.2.jar:na]
at io.seata.core.rpc.netty.AbstractNettyRemoting.lambda$processMessage$2(AbstractNettyRemoting.java:279) ~[seata-core-1.4.2.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_212]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_212]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_212]
Caused by: 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) ~[na:na]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[na:na]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[na:na]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953) ~[na:na]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092) ~[na:na]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1040) ~[na:na]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1347) ~[na:na]
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1025) ~[na:na]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeUpdate(DruidPooledPreparedStatement.java:255) ~[druid-1.1.23.jar:1.1.23]
at io.seata.server.storage.db.lock.LockStoreDataBaseDAO.unLock(LockStoreDataBaseDAO.java:267) ~[classes/:na]
... 22 common frames omitted

展开
收起
经叫唤 2024-02-28 10:35:59 167 0
0 条回答
写回答
取消 提交回答

为企业提供高效、稳定、易扩展的中间件产品。

相关电子书

更多
DTCC 2022大会集锦《云原生一站式数据库技术与实践》 立即下载
阿里云瑶池数据库精要2022版 立即下载
2022 DTCC-阿里云一站式数据库上云最佳实践 立即下载