When I provoke ONE deadlock the Innodb_deadlocks status counter is NOT increased. This contradicts the documentation:
Documentation states: Total number of InnoDB deadlocks.
https://mariadb.com/kb/en/innodb-status-variables/#innodb_deadlocks
SQL> SHOW GLOBAL STATUS LIKE '%dead%';
|
+------------------+-------+
|
| Variable_name | Value |
|
+------------------+-------+
|
| Innodb_deadlocks | 0 |
|
+------------------+-------+
|
|
SQL 1> START TRANSACTION; -- Session 1
|
SQL 2> START TRANSACTION; -- Session 2
|
SQL 1> UPDATE test SET data = 'bla' WHERE id = 2;
|
SQL 2> UPDATE test SET data = 'bla' WHERE id = 1524;
|
SQL 1> UPDATE test SET data = 'bla' WHERE id = 1524;
|
-- Session 1 hangs
|
SQL 2> UPDATE test SET data = 'bla' WHERE id = 2;
|
ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction
|
|
SQL> SHOW GLOBAL STATUS LIKE '%dead%';
|
+------------------+-------+
|
| Variable_name | Value |
|
+------------------+-------+
|
| Innodb_deadlocks | 0 |
|
+------------------+-------+
|
|
SQL> SHOW ENGINE INNODB STATUS\G
|
------------------------
|
LATEST DETECTED DEADLOCK
|
------------------------
|
2024-04-18 14:30:34 0x7f47ef687640
|
*** (1) TRANSACTION:
|
TRANSACTION 1723789, ACTIVE 14 sec starting index read
|
mysql tables in use 1, locked 1
|
LOCK WAIT 3 lock struct(s), heap size 1128, 2 row lock(s), undo log entries 1
|
MySQL thread id 382, OS thread handle 139946933352000, query id 139416 localhost root Updating
|
UPDATE test SET data = 'bla' WHERE id = 1524
|
...
|
|
*** (2) TRANSACTION:
|
TRANSACTION 1723792, ACTIVE 8 sec starting index read
|
mysql tables in use 1, locked 1
|
3 lock struct(s), heap size 1128, 2 row lock(s), undo log entries 1
|
MySQL thread id 383, OS thread handle 139946936006208, query id 139449 localhost root Updating
|
UPDATE test SET data = 'bla' WHERE id = 2
|
...
|
|
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
|
RECORD LOCKS space id 13389 page no 4 n bits 480 index PRIMARY of table `test`.`test` trx id 1723792 lock_mode X locks rec but not gap waiting
|
Record lock, heap no 3 PHYSICAL RECORD: n_fields 5; compact format; info bits 0
|
...
|
|
*** WE ROLL BACK TRANSACTION (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;
|
...
|
- relates to
-
MDEV-33935
Innodb_deadlocks status variable counts wrong
-
-
Closed
There are no comments yet on this issue.
{"report":{"fcp":1202.5,"ttfb":194.70000004768372,"pageVisibility":"visible","entityId":128808,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"8dacca6c-f3ce-4cdf-b324-4eb92741c758","navigationType":0,"readyForUser":1291.7000000476837,"redirectCount":0,"resourceLoadedEnd":1479.2000000476837,"resourceLoadedStart":209.10000014305115,"resourceTiming":[{"duration":507.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":209.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":209.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":716.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":507.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":209.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":209.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":716.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":521.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":209.5,"connectEnd":209.5,"connectStart":209.5,"domainLookupEnd":209.5,"domainLookupStart":209.5,"fetchStart":209.5,"redirectEnd":0,"redirectStart":0,"requestStart":209.5,"responseEnd":731,"responseStart":731,"secureConnectionStart":209.5},{"duration":572.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":209.70000004768372,"connectEnd":209.70000004768372,"connectStart":209.70000004768372,"domainLookupEnd":209.70000004768372,"domainLookupStart":209.70000004768372,"fetchStart":209.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":209.70000004768372,"responseEnd":782,"responseStart":782,"secureConnectionStart":209.70000004768372},{"duration":575.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":209.90000009536743,"connectEnd":209.90000009536743,"connectStart":209.90000009536743,"domainLookupEnd":209.90000009536743,"domainLookupStart":209.90000009536743,"fetchStart":209.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":209.90000009536743,"responseEnd":785.7000000476837,"responseStart":785.7000000476837,"secureConnectionStart":209.90000009536743},{"duration":576,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":210.10000014305115,"connectEnd":210.10000014305115,"connectStart":210.10000014305115,"domainLookupEnd":210.10000014305115,"domainLookupStart":210.10000014305115,"fetchStart":210.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":210.10000014305115,"responseEnd":786.1000001430511,"responseStart":786.1000001430511,"secureConnectionStart":210.10000014305115},{"duration":576.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":210.29999995231628,"connectEnd":210.29999995231628,"connectStart":210.29999995231628,"domainLookupEnd":210.29999995231628,"domainLookupStart":210.29999995231628,"fetchStart":210.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":210.29999995231628,"responseEnd":786.5,"responseStart":786.5,"secureConnectionStart":210.29999995231628},{"duration":662.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":210.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":210.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":873,"responseStart":0,"secureConnectionStart":0},{"duration":576.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":210.70000004768372,"connectEnd":210.70000004768372,"connectStart":210.70000004768372,"domainLookupEnd":210.70000004768372,"domainLookupStart":210.70000004768372,"fetchStart":210.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":210.70000004768372,"responseEnd":786.9000000953674,"responseStart":786.9000000953674,"secureConnectionStart":210.70000004768372},{"duration":662.4000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":210.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":210.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":873.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":576.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":211,"connectEnd":211,"connectStart":211,"domainLookupEnd":211,"domainLookupStart":211,"fetchStart":211,"redirectEnd":0,"redirectStart":0,"requestStart":211,"responseEnd":787.5,"responseStart":787.5,"secureConnectionStart":211},{"duration":1262.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":212.29999995231628,"connectEnd":212.29999995231628,"connectStart":212.29999995231628,"domainLookupEnd":212.29999995231628,"domainLookupStart":212.29999995231628,"fetchStart":212.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":212.29999995231628,"responseEnd":1474.7000000476837,"responseStart":1474.7000000476837,"secureConnectionStart":212.29999995231628},{"duration":1263.6000001430511,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":212.29999995231628,"connectEnd":212.29999995231628,"connectStart":212.29999995231628,"domainLookupEnd":212.29999995231628,"domainLookupStart":212.29999995231628,"fetchStart":212.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":212.29999995231628,"responseEnd":1475.9000000953674,"responseStart":1475.9000000953674,"secureConnectionStart":212.29999995231628},{"duration":96.20000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":885,"connectEnd":885,"connectStart":885,"domainLookupEnd":885,"domainLookupStart":885,"fetchStart":885,"redirectEnd":0,"redirectStart":0,"requestStart":885,"responseEnd":981.2000000476837,"responseStart":981.1000001430511,"secureConnectionStart":885},{"duration":323.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1155.2999999523163,"connectEnd":1155.2999999523163,"connectStart":1155.2999999523163,"domainLookupEnd":1155.2999999523163,"domainLookupStart":1155.2999999523163,"fetchStart":1155.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":1155.2999999523163,"responseEnd":1479.2000000476837,"responseStart":1479.2000000476837,"secureConnectionStart":1155.2999999523163}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":37,"responseStart":195,"responseEnd":207,"domLoading":200,"domInteractive":1526,"domContentLoadedEventStart":1526,"domContentLoadedEventEnd":1569,"domComplete":1915,"loadEventStart":1915,"loadEventEnd":1916,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1508.2000000476837},{"name":"bigPipe.sidebar-id.end","time":1509},{"name":"bigPipe.activity-panel-pipe-id.start","time":1509.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1509.7000000476837},{"name":"activityTabFullyLoaded","time":1575.7000000476837}],"measures":[],"correlationId":"b266aebfbfe77b","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":86,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}