Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.5.17, 10.6.17, 10.11.7, 11.5.1
-
Ubuntu Linux 22.04, n.a.
Description
When I provoke ONE deadlock the Innodb_deadlocks status counter is increase by TWO. This oversubscribes the number of deadlocks happening in a mariadb database.
Documentation states: Total number of InnoDB deadlocks.
https://mariadb.com/kb/en/innodb-status-variables/#innodb_deadlocks
So IMHO it should be 1 and not 2.
Reproducible:
SQL> SHOW GLOBAL STATUS LIKE '%dead%';
|
+------------------+-------+
|
| Variable_name | Value |
|
+------------------+-------+
|
| Innodb_deadlocks | 0 |
|
+------------------+-------+
|
|
Session 1> START TRANSACTION;
|
Session 2> START TRANSACTION;
|
Session 1> UPDATE test SET data = 'bla' WHERE id = 2;
|
Session 2> UPDATE test SET data = 'bla' WHERE id = 1524;
|
Session 1> UPDATE test SET data = 'bla' WHERE id = 1524;
|
Session 2> UPDATE test SET data = 'bla' WHERE id = 2;
|
|
SQL> SHOW GLOBAL STATUS LIKE '%dead%';
|
+------------------+-------+
|
| Variable_name | Value |
|
+------------------+-------+
|
| Innodb_deadlocks | 2 |
|
+------------------+-------+
|
Table:
CREATE TABLE `test` ( |
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, |
`data` varchar(128) DEFAULT NULL, |
`ts` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), |
PRIMARY KEY (`id`) |
);
|
Data:
INSERT INTO test SELECT NULL, 'Some data', NOW(); |
INSERT INTO test SELECT NULL, 'Some data', NOW() FROM test; |
...
|
Attachments
Issue Links
- blocks
-
MDEV-20043 Innodb_deadlocks status counter
- Closed
- relates to
-
MDEV-33937 Innodb_deadlocks status variable counts wrong
- Open