🐬记一次MySQL执行修改语句超时问题
异常问题
原因分析
这个问题发生在开发环境,怀疑是提交事务时终止项目运行,没有提交该事务,造成死锁
调试该事务时时间太长,为什么说有这个原因呢,因为通过查找日志显示
The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.
问题排查
# 当前运行的所有事务
select * from information_schema.innodb_trx;
# 查看锁的持有和请求情况 MySQL8.0
select * from performance_schema.data_locks;
# 查看锁的等待情况 MySQL8.0
select * from performance_schema.data_lock_waits;
# 当前线程详情
show full processlist;
1.发现事务id176602一直在运行状态
锁的持有和请求情况
......
暂无评论...