← Back to team overview

enterprise-support team mailing list archive

[Bug 1466414] [NEW] Deadlocks missed by INFORMATION_SCHEMA.INNODB_METRICS lock_deadlocks counter

 

Public bug reported:

Copy of http://bugs.mysql.com/bug.php?id=77399 (the testcase is based on
percona_innodb_deadlock_count with I_S.I_M support added)

[18 Jun 8:22] Laurynas Biveinis
Description:
Some deadlocks do not bump the INFORMATION_SCHEMA.INNODB_METRICS lock_deadlocks counter. The MTR below will result in

SELECT NAME, COUNT, COMMENT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME="lock_deadlocks";
NAME	COUNT	COMMENT
lock_deadlocks	0	Number of deadlocks

But if you check ie. engine status, you will see

------------------------
LATEST DETECTED DEADLOCK
------------------------
2015-06-18 11:20:16 10d7a0000
*** (1) TRANSACTION:
TRANSACTION 1292, ACTIVE 0 sec starting index read
... info ...

How to repeat:
--source include/have_innodb.inc

connect (con1,localhost,root,,);
connect (con2,localhost,root,,);

create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
insert into t values(2,1);
insert into t values(1,2);

SET GLOBAL innodb_monitor_reset=lock_deadlocks;

connection con1;
BEGIN; SELECT b FROM t WHERE a=1 FOR UPDATE;

connection con2;
BEGIN; SELECT b FROM t WHERE a=2 FOR UPDATE;

connection con1;
SEND SELECT b FROM t WHERE a=2 FOR UPDATE;

connection con2;
SEND SELECT b FROM t WHERE a=1 FOR UPDATE;

connection con1;
--error 0,ER_LOCK_DEADLOCK
reap;
ROLLBACK;

connection con2;
--error 0,ER_LOCK_DEADLOCK
reap;
ROLLBACK;

connection default;

SELECT NAME, COUNT, COMMENT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE
NAME="lock_deadlocks";

** Affects: mysql-server
     Importance: Unknown
         Status: Unknown

** Affects: percona-server
     Importance: Undecided
         Status: New

** Affects: percona-server/5.1
     Importance: Undecided
         Status: Invalid

** Affects: percona-server/5.5
     Importance: Undecided
         Status: Invalid

** Affects: percona-server/5.6
     Importance: Undecided
         Status: New

** Affects: percona-server/5.7
     Importance: Medium
     Assignee: Laurynas Biveinis (laurynas-biveinis)
         Status: Fix Committed


** Tags: upstream

** Also affects: percona-server/5.1
   Importance: Undecided
       Status: New

** Also affects: percona-server/5.6
   Importance: Undecided
       Status: New

** Also affects: percona-server/5.7
   Importance: Undecided
       Status: New

** Also affects: percona-server/5.5
   Importance: Undecided
       Status: New

** Changed in: percona-server/5.1
       Status: New => Invalid

** Changed in: percona-server/5.5
       Status: New => Invalid

** Changed in: percona-server/5.7
       Status: New => Triaged

** Changed in: percona-server/5.7
       Status: Triaged => Fix Committed

** Changed in: percona-server/5.7
   Importance: Undecided => Medium

** Changed in: percona-server/5.7
     Assignee: (unassigned) => Laurynas Biveinis (laurynas-biveinis)

** Tags added: upstream

** Bug watch added: MySQL Bug System #77399
   http://bugs.mysql.com/bug.php?id=77399

** Also affects: mysql-server via
   http://bugs.mysql.com/bug.php?id=77399
   Importance: Unknown
       Status: Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Server/Client Support Team, which is subscribed to MySQL.
Matching subscriptions: Ubuntu Server/Client Support Team
https://bugs.launchpad.net/bugs/1466414

Title:
  Deadlocks missed by INFORMATION_SCHEMA.INNODB_METRICS lock_deadlocks
  counter

To manage notifications about this bug go to:
https://bugs.launchpad.net/mysql-server/+bug/1466414/+subscriptions


Follow ups

References