Hey guys,
Today, i faced an issue with transaction getting dead locked in mysql. i was unable to perform any action on the locked table.
I created a transaction with autocommit : false and forgot to either rollbock or commit the transaction.
At the same time another transaction been created and tried to access the same table and final result is
ER_LOCK_WAIT_TIMEOUT: Lock wait timeout exceeded; try restarting transaction
SHOW PROCESSLIST
See if your query is present in the processes and kill the <id> which causing the table lock.
KILL <processid>
Above command did not help me as process or query id is not present to overcome the problem.
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 5367
OS WAIT ARRAY INFO: signal count 4706
RW-shared spins 0, rounds 2666, OS waits 728
RW-excl spins 0, rounds 1878, OS waits 44
RW-sx spins 34, rounds 217, OS waits 4
Spin rounds per wait: 2666.00 RW-shared, 1878.00 RW-excl, 6.38 RW-sx
------------
TRANSACTIONS
------------
Trx id counter 418476
Purge done for trx's n:o < 418416 undo n:o < 0 state: running but idle
History list length 0
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 421985361275640, not started
0 lock struct(s), heap size 1136, 0 row lock(s)
---TRANSACTION 421985361274720, not started
0 lock struct(s), heap size 1136, 0 row lock(s)
--------