Sample Header Ad - 728x90

Many transactions are getting stuck in the "cleaning up" state - what could cause that?

3 votes
1 answer
6366 views
I'm trying to track down a locking issue, and found via SHOW PROCESSLIST that when the queries in question are waiting for locks and timing out, there are no other queries active in the process list. So I looked at SHOW ENGINE INNODB STATUS, which showed that when the transactions in question are waiting on locks, the only other tansactions present that have started (there are many in thenot started state) are ones that have been running for 30 seconds or more, and are in the cleaning up state. Why would a transaction get stuck in the cleaning up state? Is there any way to tell at that point, what any of the original queries were for that transaction? (The transaction does not appear to be present in the information_schema.innodb_trx table). Example output: ---TRANSACTION 2670738352, ACTIVE 25 sec 2 lock struct(s), heap size 360, 1 row lock(s), undo log entries 1 MySQL thread id 158609, OS thread handle 0x2ae9a6bcf700, query id 487681086 10.0.1.246 ownlocal cleaning up Trx read view will not see trx with id >= 2670738353, sees = 2670737972, sees = 2670736876, sees = 2670735437, sees < 2670724054 ### Additional Info: ### - **MySQL Version:** 5.6 - **Storage Engine:** InnoDB
Asked by mltsy (159 rep)
Dec 16, 2014, 12:12 AM
Last activity: May 29, 2025, 08:01 AM