Bug #31071 Counter of deadlocks
Submitted: 17 Sep 2007 23:24 Modified: 3 Jun 2010 7:34
Reporter: Nicklas Westerlund (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:5.1.21 OS:MacOS
Assigned to: Assigned Account CPU Architecture:Any
Tags: Contribution

[17 Sep 2007 23:24] Nicklas Westerlund
Description:
It would be nice to have a global counter of amount of deadlocks occured in InnoDB, to be able to see the scope of the problem.

How to repeat:
get a deadlock (mysqlslap is great at doing this..)

Suggested fix:
patch lock0lock.c to count deadlocks.
[18 Sep 2007 9:18] Valeriy Kravchuk
Thank you for a reasonable feature request and contributed patch.
[18 Sep 2007 20:34] Nicklas Westerlund
You're welcome.
Would it be able to get this pushed into 5.0 as well?
[19 Dec 2008 11:10] Mark Leith
Hi Nick,

I just came across this - and it looks like a good addition. However, I think it would be better added as a status variable than in SHOW INNODB STATUS (parsing that is already a nightmare).

Could you look at adding it as a status variable instead, or as well?
[19 Dec 2008 11:17] Nicklas Westerlund
Sure, I was actually discussing that during OpenSQL Camp in November, but I just haven't gotten around to doing it yet. 

I'll see if I get time to do it this weekend.
[30 Dec 2008 1:54] Nicklas Westerlund
patch to show status both in show engine innodb status; and show status/show global status;

Attachment: innodb_deadlock_counter.patch (application/octet-stream, text), 3.36 KiB.

[26 May 2010 5:45] Jimmy Yang
This counter will be part of information schema metrics table counter integrated for 5.6 release