麻烦懂死锁的大神帮我分析一下这个死锁日志呀,感谢
发布于 1 个月前 作者 songkangle 294 次浏览 来自 问答

LATEST DETECTED DEADLOCK

2017-10-10 21:02:24 7f15a8971700 ==================================================事务1============================================ *** (1) TRANSACTION: TRANSACTION 9982081, ACTIVE 1 sec inserting //事务号 mysql tables in use 2, locked 2 //正在使用2个表,且涉及锁的表有2个 LOCK WAIT 260 lock struct(s), heap size 30248, 6340 row lock(s), undo log entries 2110 //等待260个锁,占用内存30248字节。 涉及6340行记录。 MySQL thread id 218922, OS thread handle 0x7f159ea36700, query id 78426474 103.95.95.45 ekb Sending data //事务1正在执行的语句: INSERT INTO stock_spec(warehouse_id,spec_id,order_num) (SELECT P_NewWarehouseID,spec_id,actual_num FROM sales_trade_order WHERE trade_id=P_TradeID AND actual_num>0 AND stock_reserved<2 ORDER BY spec_id) ON DUPLICATE KEY UPDATE order_num=order_num+VALUES(order_num) *** (1) WAITING FOR THIS LOCK TO BE GRANTED: //表示第一个事务正在等待锁被授予 UNIQUE KEY UK_stock_spec (spec_id,warehouse_id) RECORD LOCKS space id 9990 page no 366 n bits 544 index UK_stock_spec of table erp_dev.stock_spec trx id 9982081 lock_mode X waiting Record lock, heap no 469 PHYSICAL RECORD: n_fields 3; compact format; info bits 0 0: len 4; hex 800000c9; asc ;; 1: len 2; hex 8001; asc ;; 2: len 8; hex 8000000000033463; asc 4c;; ================================================事务2=================================================== *** (2) TRANSACTION: TRANSACTION 9982078, ACTIVE 1 sec starting index read mysql tables in use 1, locked 1 //涉及一个表,锁1 24 lock struct(s), heap size 2936, 16 row lock(s), undo log entries 7 MySQL thread id 218923, OS thread handle 0x7f15a8971700, query id 78426479 103.95.95.45 ekb updating UPDATE sales_trade SET trade_status=55,checker_id=1,stockout_no=‘CK20171010831’,checkouter_id=0,sales_score=0.0000,check_step=1,version_id=version_id+1 WHERE trade_id =6330 AND version_id=2 *** (2) HOLDS THE LOCK(S): //持有的锁 RECORD LOCKS space id 9990 page no 366 n bits 544 index UK_stock_spec of table erp_dev.stock_spec trx id 9982078 lock_mode X Record lock, heap no 469 PHYSICAL RECORD: n_fields 3; compact format; info bits 0 0: len 4; hex 800000c9; asc ;; 1: len 2; hex 8001; asc ;; 2: len 8; hex 8000000000033463; asc 4c;;

*** (2) WAITING FOR THIS LOCK TO BE GRANTED: RECORD LOCKS space id 9954 page no 321 n bits 96 index PRIMARY of table erp_dev.sales_trade trx id 9982078 lock_mode X locks rec but not gap waiting Record lock, heap no 5 PHYSICAL RECORD: n_fields 109; compact format; info bits 0 0: len 4; hex 800018ba; asc ;; 1: len 6; hex 000000985081; asc P ;; 2: len 7; hex 77000002062936; asc w )6;; 3: len 14; hex 4a59323031373130313031313031; asc JY201710101101;; 4: len 1; hex 8d; asc ;; 5: len 2; hex 8001; asc ;; 6: len 2; hex 8001; asc ;; 7: len 1; hex 81; asc ;; 8: len 13; hex 32303137313031353030323034; asc 2017101500204;; 9: len 0; hex ; asc ;; 10: len 1; hex 9e; asc ;; 11: len 1; hex 80; asc ;; 12: len 4; hex 80000000; asc ;; 13: len 1; hex 83; asc ;; 14: len 1; hex 81; asc ;; 15: len 1; hex 81; asc ;; 16: len 2; hex 8000; asc ;; 17: len 1; hex 80; asc ;; 18: len 1; hex 82; asc ;; 19: len 1; hex 80; asc ;; 20: len 0; hex ; asc ;; 21: len 5; hex 8cb2420000; asc B ;; 22: len 5; hex 8cb2420000; asc B ;; 23: len 4; hex 80000000; asc ;; 24: len 9; hex 800000000000010000; asc ;; 25: len 2; hex 8001; asc ;; 26: len 30; hex e4bf9de5ae8120e5a9b4e584bfe6b497e8a1a3e6b6b22fe5a9b4e584bfe6; asc / ; (total 80 bytes); 27: len 9; hex 800000000000010000; asc ;; 28: len 2; hex 8001; asc ;; 29: len 1; hex 80; asc ;; 30: len 4; hex 800016d6; asc ;; 31: len 14; hex 4d4f423138373839383939303930; asc MOB18789899090;; 32: len 1; hex 80; asc ;; 33: len 0; hex ; asc ;; 34: len 11; hex e78e8be88081e590893230; asc 20;; 35: len 2; hex 8000; asc ;; 36: len 4; hex 8001adb0; asc ;; 37: len 4; hex 80000000; asc ;; 38: len 4; hex 80000000; asc ;; 39: len 12; hex e5a4a9e58d9ae4b8ade6b6a6; asc ;; 40: len 11; hex 3138373839383939303930; asc 18789899090;; 41: len 0; hex ; asc ;; 42: len 0; hex ; asc ;; 43: len 20; hex e58c97e4baac20e58c97e4baac20e6b5b7e6b780; asc ;; 44: len 0; hex ; asc ;; 45: len 0; hex ; asc ;; 46: len 0; hex ; asc ;; 47: len 0; hex ; asc ;; 48: len 0; hex ; asc ;; 49: len 1; hex 80; asc ;; 50: len 2; hex 8003; asc ;; 51: len 0; hex ; asc ;; 52: len 0; hex ; asc ;; 53: len 0; hex ; asc ;; 54: len 1; hex 80; asc ;; 55: len 0; hex ; asc ;; 56: len 2; hex 8000; asc ;; 57: len 1; hex 80; asc ;; 58: len 1; hex 80; asc ;; 59: len 2; hex 8000; asc ;; 60: len 9; hex 800000000000000000; asc ;; 61: len 9; hex 800000000000000000; asc ;; 62: len 9; hex 800000000000000000; asc ;; 63: len 9; hex 800000000000000000; asc ;; 64: len 9; hex 800000000000000000; asc ;; 65: len 9; hex 800000000000000000; asc ;; 66: len 9; hex 800000000000000000; asc ;; 67: len 9; hex 800000000000000000; asc ;; 68: len 9; hex 800000000000000000; asc ;; 69: len 9; hex 800000000000000000; asc ;; 70: len 9; hex 800000000000000000; asc ;; 71: len 9; hex 800000000000000000; asc ;; 72: len 9; hex 8000000000000f0000; asc ;; 73: len 9; hex 800000000000000000; asc ;; 74: len 9; hex 7ffffffffffff0ffff; asc ;; 75: len 9; hex 800000000000000000; asc ;; 76: len 9; hex 800000000000000000; asc ;; 77: len 9; hex 800000000000000000; asc ;; 78: len 9; hex 800000000000000000; asc ;; 79: len 9; hex 800000000000000000; asc ;; 80: len 9; hex 800000000000000000; asc ;; 81: len 1; hex 80; asc ;; 82: len 0; hex ; asc ;; 83: len 0; hex ; asc ;; 84: len 4; hex 80000000; asc ;; 85: len 4; hex 80000000; asc ;; 86: len 4; hex 80000000; asc ;; 87: len 4; hex 80000000; asc ;; 88: len 4; hex 80000000; asc ;; 89: len 4; hex 80000000; asc ;; 90: len 4; hex 80000000; asc ;; 91: len 2; hex 8000; asc ;; 92: len 4; hex 80000000; asc ;; 93: len 1; hex 80; asc ;; 94: len 1; hex 80; asc ;; 95: len 4; hex 80000000; asc ;; 96: len 1; hex 80; asc ;; 97: len 0; hex ; asc ;; 98: len 4; hex 80000000; asc ;; 99: len 4; hex 80000000; asc ;; 100: len 2; hex 8000; asc ;; 101: len 2; hex 8000; asc ;; 102: len 1; hex 80; asc ;; 103: len 4; hex 80000000; asc ;; 104: len 4; hex 80000000; asc ;; 105: len 0; hex ; asc ;; 106: len 2; hex 8002; asc ;; 107: len 5; hex 999dd55098; asc P ;; 108: len 5; hex 999dd50923; asc #;;

*** WE ROLL BACK TRANSACTION (2)

TRANSACTIONS

Trx id counter 9984287 Purge done for trx’s n:o < 9984287 undo n:o < 0 state: running but idle History list length 360 LIST OF TRANSACTIONS FOR EACH SESSION: —TRANSACTION 0, not started MySQL thread id 218921, OS thread handle 0x7f15a8a34700, query id 78500923 103.95.95.45 ekb init

回到顶部