目录

问题描述:

问题发生原因:

问题日志详情:


问题描述:

生产启动的时候,定期排查的 一些日志,发现一个问题呢,主要是加锁了,很奇怪,主要是业务数据的一般的CURD。至于其他的很奇怪!主要查看业务代码。

问题发生原因:

删除的时候,尽量不能使用索引进行删除,一个过千万的数据量,在根据索引删除数据的时候,会有很大的问题!主要是根据索引删除数据,会有一个间隙锁,在加锁间隙又插入这个表,那么会爆出这个死锁!

 

问题日志详情:

### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: xxx..money.mastercontrol.dao.mapper.biz.BizNewsEventMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction
### Cause: org.apache.ibatis.executor.BatchExecutorException: xxx..money.mastercontrol.dao.mapper.biz.BizNewsEventMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction","flowType": "-1","flowDesc": "kafka消息处理失败"}
2022-07-19 00:42:09.521 [audit_platform_to_bus-0-C-1] ERROR c.g.h.m.p.consumer.AbstractConsumer - 
### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: xxx..money.mastercontrol.dao.mapper.biz.BizNewsEventMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction
### Cause: org.apache.ibatis.executor.BatchExecutorException: xxx..money.mastercontrol.dao.mapper.biz.BizNewsEventMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction
org.apache.ibatis.exceptions.PersistenceException: 
### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: xxx..money.mastercontrol.dao.mapper.biz.BizNewsEventMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction
### Cause: org.apache.ibatis.executor.BatchExecutorException: xxx..money.mastercontrol.dao.mapper.biz.BizNewsEventMapper.insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: Deadlock found when trying to get lock; try restarting transaction
 

Logo

Kafka开源项目指南提供详尽教程,助开发者掌握其架构、配置和使用,实现高效数据流管理和实时处理。它高性能、可扩展,适合日志收集和实时数据处理,通过持久化保障数据安全,是企业大数据生态系统的核心。

更多推荐