問題1:線上mysql更新報錯
Update All error:【SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction
The SQL being executed was: UPDATE `amz_email` SET `is_read`=1 WHERE `id`='28785'】
一開始發(fā)現(xiàn)是int => sting 未走索引引起來,于是調(diào)整SQL為
UPDATE `amz_email` SET `solved_type`=2, `response_needed`=0, `as_status`=1 WHERE `id`=28773
系統(tǒng)繼續(xù)報錯
Update All error:【SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction
The SQL being executed was: UPDATE `amz_email` SET `solved_type`=2, `response_needed`=0, `as_status`=1 WHERE `id`=28773】
一 查看innodb的鎖 顯示正常
select * from information_schema.innodb_locks
image.png
二 查看事務(wù)提交情況
select * from information_schema.INNODB_TRX; 發(fā)現(xiàn)有條件事務(wù)一直未提交
企業(yè)微信截圖_16696950592704.png
三 查看show PROCESSLIST;發(fā)貨12956643這條回話狀態(tài)為sleep狀態(tài)
企業(yè)微信截圖_16696950666785.png
kill 12956643 這條會話 服務(wù)恢復(fù)正常