专注 K8S研究
分类: Mysql/postgreSQL
2013-07-24 01:32:06
原文地址:[HowTo]-死锁 作者:ning_lianjie
参考<<高性能MySQL>>
问题分析
附:
死锁信息
登录MySQL执行SHOW ENGINE INNODB STATUS\G命令 ... LATEST DETECTED DEADLOCK ------------------------ 121029 14:46:44 -- 死锁发生的时间 *** (1) TRANSACTION: TRANSACTION 1B02B0FAC, ACTIVE 5 sec fetching rows mysql tables in use 1, locked 1 LOCK WAIT 86 lock struct(s), heap size 14776, 11642 row lock(s), undo log entries 1436 MySQL thread id 51989134, OS thread handle 0x6482b940, query id 37321665747 ......-- 第(1)个事务信息 *** (1) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 17689 page no 1606 n bits 760 ......
lock_mode X waiting -- 第(1)个事务等待的锁 *** (2) TRANSACTION: TRANSACTION 1B02B2776, ACTIVE 0 sec fetching rows, thread declared inside InnoDB 500 mysql tables in use 1, locked 1 4 lock struct(s), heap size 1248, 11 row lock(s) MySQL thread id 51984598, OS thread handle 0x6d9a8940, query id 37321665253 ......-- 第(2)个事务状态 *** (2) HOLDS THE LOCK(S): RECORD LOCKS space id 17689 page no 1606 n bits 760 index ...... -- 第(2)个事务持有的锁:该锁就是第(1)个事务在等待的. *** (2) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 17689 page no 1606 n bits 760 index ...... -- 第(2)个事务等待的锁. *** WE ROLL BACK TRANSACTION (2) -- 回滚了第(2)个事务 ...