How can I clear a transaction deadlock?

后端 未结 3 2060
小鲜肉
小鲜肉 2020-12-15 06:27

Using \'show engine innodb status\' I see that wordpress has two deadlocks. I\'d like to clear these up but I don\'t see an active process for either of these cmds (IE somet

3条回答
  •  悲&欢浪女
    2020-12-15 07:30

    Using 'show engine innodb status' I see that wordpress has two deadlocks... Suggestions on how to resolve this?

    We were seeing Java hibernate issues causing stuck locks. We found the locks by combing trough the output from:

    show engine innodb status;
    

    This spits out a crap-ton of information. The relevant section is in the TRANSACTIONS section. In your output the relevant problem seems to be:

    3 lock struct(s), heap size 1248, 2 row lock(s)
    MySQL thread id 12505095, query id 909492789 juno....edu 129.....54 
    

    For us it was the # lock struct(s) that indicated a stuck lock. To kill it you need to execute by using the "thread id #" specified -- in this case:

    kill 12505095
    

    This worked on AWS MySQL RDS as well as local MySQL.

    In our TRANSACTIONS section we also see the following:

    ---TRANSACTION 644793773, ACTIVE 21 sec
    2 lock struct(s), heap size 360, 1 row lock(s)
    MySQL thread id 217, OS thread handle 0x2aef097700, query id 1177 1.3.5.7 mpsp cleaning up
    

    We look for both the 2 lock struct(s) and the ACTIVE 21 sec messages.

提交回复
热议问题