-
Bug
-
-
Major
-
Resolution:
Fixed
-
10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
-
-
-
The deadlock section in SHOW ENGINE INNODB STATUS is always showing transaction 0 as being rolled back:
*** WE ROLL BACK TRANSACTION (0)
|
How to reproduce:
Use MariaDB 10.8 and generate a deadlock, then check SHOW ENGINE INNODB STATUS\G in the LATEST DETECTED DEADLOCK section.
mariadb session1> create table t1 (id int primary key, f1 int);
|
mariadb session1> insert into t1 values (1,1), (2,2);
|
mariadb session1> begin;
|
mariadb session1> update t1 set f1 = 3 where id = 1;
|
|
mariadb session2> begin;
|
mariadb session2> update t1 set f1 = 4 where id = 2;
|
|
mariadb session1> update t1 set f1 = 3 where id = 2;
|
|
mariadb session2> update t1 set f1 = 5 where id = 1;
|
– deadlock will be detected here. Check with:
mariadb> show engine innodb status\G
|
|
------------------------
|
LATEST DETECTED DEADLOCK
|
------------------------
|
2022-07-28 02:21:20 0x7f1ab00f9700
|
*** (1) TRANSACTION:
|
TRANSACTION 54, ACTIVE 15 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
|
MariaDB thread id 12, OS thread handle 139752599688960, query id 105 localhost root Updating
|
update t1 set f1 = 5 where id = 1
|
*** WAITING FOR THIS LOCK TO BE GRANTED:
|
RECORD LOCKS space id 6 page no 3 n bits 8 index PRIMARY of table `test`.`t1` trx id 54 lock_mode X locks rec but not gap waiting
|
Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
|
0: len 4; hex 80000001; asc ;;
|
1: len 6; hex 000000000035; asc 5;;
|
2: len 7; hex 16000001480110; asc H ;;
|
3: len 4; hex 80000003; asc ;;
|
|
*** CONFLICTING WITH:
|
RECORD LOCKS space id 6 page no 3 n bits 8 index PRIMARY of table `test`.`t1` trx id 53 lock_mode X locks rec but not gap
|
Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
|
0: len 4; hex 80000001; asc ;;
|
1: len 6; hex 000000000035; asc 5;;
|
2: len 7; hex 16000001480110; asc H ;;
|
3: len 4; hex 80000003; asc ;;
|
|
|
*** (2) TRANSACTION:
|
TRANSACTION 53, ACTIVE 46 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
|
MariaDB thread id 13, OS thread handle 139752600917760, query id 104 localhost root Updating
|
update t1 set f1 = 3 where id = 2
|
*** WAITING FOR THIS LOCK TO BE GRANTED:
|
RECORD LOCKS space id 6 page no 3 n bits 8 index PRIMARY of table `test`.`t1` trx id 53 lock_mode X locks rec but not gap waiting
|
Record lock, heap no 3 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
|
0: len 4; hex 80000002; asc ;;
|
1: len 6; hex 000000000036; asc 6;;
|
2: len 7; hex 17000001490110; asc I ;;
|
3: len 4; hex 80000004; asc ;;
|
|
*** CONFLICTING WITH:
|
RECORD LOCKS space id 6 page no 3 n bits 8 index PRIMARY of table `test`.`t1` trx id 54 lock_mode X locks rec but not gap
|
Record lock, heap no 3 PHYSICAL RECORD: n_fields 4; compact format; info bits 0
|
0: len 4; hex 80000002; asc ;;
|
1: len 6; hex 000000000036; asc 6;;
|
2: len 7; hex 17000001490110; asc I ;;
|
3: len 4; hex 80000004; asc ;;
|
|
*** WE ROLL BACK TRANSACTION (0)
|
As we can see there, there is no TRANSACTION listed with ID 0 in there.
This is the same if we generate a deadlock involving three transactions:
------------------------
|
LATEST DETECTED DEADLOCK
|
------------------------
|
2022-07-28 01:44:51 0x7f1ab018f700
|
*** (1) TRANSACTION:
|
TRANSACTION 36, ACTIVE 185 sec starting index read
|
...
|
*** (2) TRANSACTION:
|
TRANSACTION 37, ACTIVE 171 sec starting index read
|
...
|
*** (3) TRANSACTION:
|
TRANSACTION 38, ACTIVE 160 sec starting index read
|
|
*** WE ROLL BACK TRANSACTION (0)
|
Let me know if there is anything else I should provide here.
shell> mysql
|
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
Your MariaDB connection id is 15
|
Server version: 10.8.3-MariaDB-log MariaDB Server
|
|
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
|
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
Thanks!
- relates to
-
MDEV-24738
Improve the InnoDB deadlock checker
-
-
Closed
{"report":{"fcp":871.3999998569489,"ttfb":308.2000000476837,"pageVisibility":"visible","entityId":113247,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"8be26ff2-8f14-4a19-93a0-212251ce4a95","navigationType":0,"readyForUser":960.5999999046326,"redirectCount":0,"resourceLoadedEnd":1083.8999998569489,"resourceLoadedStart":314.2999999523163,"resourceTiming":[{"duration":73.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":314.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":314.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":387.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":73.10000014305115,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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","startTime":314.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":314.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":387.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":82.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":314.7000000476837,"connectEnd":314.7000000476837,"connectStart":314.7000000476837,"domainLookupEnd":314.7000000476837,"domainLookupStart":314.7000000476837,"fetchStart":314.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":314.7000000476837,"responseEnd":397.5,"responseStart":397.5,"secureConnectionStart":314.7000000476837},{"duration":195.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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","startTime":314.7999999523163,"connectEnd":314.7999999523163,"connectStart":314.7999999523163,"domainLookupEnd":314.7999999523163,"domainLookupStart":314.7999999523163,"fetchStart":314.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":314.7999999523163,"responseEnd":510.09999990463257,"responseStart":510.09999990463257,"secureConnectionStart":314.7999999523163},{"duration":198.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":314.89999985694885,"connectEnd":314.89999985694885,"connectStart":314.89999985694885,"domainLookupEnd":314.89999985694885,"domainLookupStart":314.89999985694885,"fetchStart":314.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":314.89999985694885,"responseEnd":513.7999999523163,"responseStart":513.7999999523163,"secureConnectionStart":314.89999985694885},{"duration":200.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":315,"connectEnd":315,"connectStart":315,"domainLookupEnd":315,"domainLookupStart":315,"fetchStart":315,"redirectEnd":0,"redirectStart":0,"requestStart":315,"responseEnd":515.3999998569489,"responseStart":515.3999998569489,"secureConnectionStart":315},{"duration":203,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":315.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":315.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":518.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":201.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":315.2000000476837,"connectEnd":315.2000000476837,"connectStart":315.2000000476837,"domainLookupEnd":315.2000000476837,"domainLookupStart":315.2000000476837,"fetchStart":315.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":315.2000000476837,"responseEnd":516.7999999523163,"responseStart":516.7999999523163,"secureConnectionStart":315.2000000476837},{"duration":202.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":315.2999999523163,"connectEnd":315.2999999523163,"connectStart":315.2999999523163,"domainLookupEnd":315.2999999523163,"domainLookupStart":315.2999999523163,"fetchStart":315.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":315.2999999523163,"responseEnd":518.2000000476837,"responseStart":518.2000000476837,"secureConnectionStart":315.2999999523163},{"duration":204.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":315.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":315.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":519.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":204.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":315.59999990463257,"connectEnd":315.59999990463257,"connectStart":315.59999990463257,"domainLookupEnd":315.59999990463257,"domainLookupStart":315.59999990463257,"fetchStart":315.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":315.59999990463257,"responseEnd":519.7000000476837,"responseStart":519.5999999046326,"secureConnectionStart":315.59999990463257},{"duration":760.3999998569489,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":321.2000000476837,"connectEnd":321.2000000476837,"connectStart":321.2000000476837,"domainLookupEnd":321.2000000476837,"domainLookupStart":321.2000000476837,"fetchStart":321.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":321.2000000476837,"responseEnd":1081.5999999046326,"responseStart":1081.5999999046326,"secureConnectionStart":321.2000000476837},{"duration":761.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":321.59999990463257,"connectEnd":321.59999990463257,"connectStart":321.59999990463257,"domainLookupEnd":321.59999990463257,"domainLookupStart":321.59999990463257,"fetchStart":321.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":321.59999990463257,"responseEnd":1082.8999998569489,"responseStart":1082.8999998569489,"secureConnectionStart":321.59999990463257},{"duration":44.799999952316284,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":551.0999999046326,"connectEnd":551.0999999046326,"connectStart":551.0999999046326,"domainLookupEnd":551.0999999046326,"domainLookupStart":551.0999999046326,"fetchStart":551.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":551.0999999046326,"responseEnd":595.8999998569489,"responseStart":595.8999998569489,"secureConnectionStart":551.0999999046326},{"duration":296.89999985694885,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":786.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":786.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1083.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":296.7999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/50bc9be5bfead1a25e72c1a9338c94f6-CDN/lu2bu7/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/css/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":787.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":787.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1083.8999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":352.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/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","startTime":787.8999998569489,"connectEnd":787.8999998569489,"connectStart":787.8999998569489,"domainLookupEnd":787.8999998569489,"domainLookupStart":787.8999998569489,"fetchStart":787.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":787.8999998569489,"responseEnd":1140.2999999523163,"responseStart":1140.2999999523163,"secureConnectionStart":787.8999998569489},{"duration":367.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":788.2999999523163,"connectEnd":788.2999999523163,"connectStart":788.2999999523163,"domainLookupEnd":788.2999999523163,"domainLookupStart":788.2999999523163,"fetchStart":788.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":788.2999999523163,"responseEnd":1155.5999999046326,"responseStart":1155.5999999046326,"secureConnectionStart":788.2999999523163}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":175,"responseStart":308,"responseEnd":320,"domLoading":312,"domInteractive":1106,"domContentLoadedEventStart":1106,"domContentLoadedEventEnd":1149,"domComplete":1598,"loadEventStart":1598,"loadEventEnd":1600,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1089},{"name":"bigPipe.sidebar-id.end","time":1089.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1089.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1092.5},{"name":"activityTabFullyLoaded","time":1157.2000000476837}],"measures":[],"correlationId":"f7bc070c3e0919","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":71,"dbReadsTimeInMs":11,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}