-
Bug
-
-
Major
-
Resolution:
Unresolved
-
10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11
-
-
-
While MDEV-10962 is deadlock on concurrent acquisition of multiple types similarly deadlock happens on concurrent acquisition from multiple indexes.
Reproduce
# MDEV-22698 Deadlock on concurrent acquisition from multiple indexes
|
--source include/have_innodb.inc
|
create table t1 (a int unique) engine innodb;
|
insert into t1 values (1);
|
connect (con1, localhost, root,, test);
|
set debug_sync= 'after_lock_clust_rec_read_check_and_lock wait_for clust_locked';
|
send delete from t1;
|
connection default;
|
set debug_sync= 'after_lock_clust_rec_read_check_and_lock signal clust_locked';
|
--error ER_LOCK_DEADLOCK
|
delete from t1 where a = 1;
|
show engine innodb status;
|
connection con1;
|
reap;
|
connection default;
|
disconnect con1;
|
drop table t1;
|
set debug_sync= reset;
|
Result
*** (1) TRANSACTION:
|
TRANSACTION 1287, ACTIVE 0 sec starting index read
|
mysql tables in use 1, locked 1
|
LOCK WAIT 3 lock struct(s), heap size 1152, 2 row lock(s)
|
MySQL thread id 9, OS thread handle 140665229768448, query id 22 localhost root updating
|
delete from t1 where a = 1
|
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
|
RECORD LOCKS space id 4 page no 3 n bits 72 index GEN_CLUST_INDEX of table `test`.`t1` trx id 1287 lock_mode X locks rec but not gap waiting
|
Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 32
|
0: len 6; hex 000000000200; asc ;;
|
1: len 6; hex 000000000506; asc ;;
|
2: len 7; hex 04000001460110; asc F ;;
|
3: len 4; hex 80000001; asc ;;
|
|
*** (2) TRANSACTION:
|
TRANSACTION 1286, ACTIVE 0 sec updating or deleting
|
mysql tables in use 1, locked 1
|
3 lock struct(s), heap size 1152, 2 row lock(s), undo log entries 1
|
MySQL thread id 10, OS thread handle 140665229461248, query id 21 localhost root updating
|
delete from t1
|
*** (2) HOLDS THE LOCK(S):
|
RECORD LOCKS space id 4 page no 3 n bits 72 index GEN_CLUST_INDEX of table `test`.`t1` trx id 1286 lock_mode X
|
Record lock, heap no 2 PHYSICAL RECORD: n_fields 4; compact format; info bits 32
|
0: len 6; hex 000000000200; asc ;;
|
1: len 6; hex 000000000506; asc ;;
|
2: len 7; hex 04000001460110; asc F ;;
|
3: len 4; hex 80000001; asc ;;
|
|
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
|
RECORD LOCKS space id 4 page no 4 n bits 72 index a of table `test`.`t1` trx id 1286 lock_mode X locks rec but not gap waiting
|
Record lock, heap no 2 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
|
0: len 4; hex 80000001; asc ;;
|
1: len 6; hex 000000000200; asc ;;
|
|
*** WE ROLL BACK TRANSACTION (1)
|
Fix
The fix could be the same principle as for MDEV-10962: prioritization over waiting locks.
- relates to
-
MDEV-10962
Deadlock with 3 concurrent DELETEs by unique key
-
-
Closed
{"report":{"fcp":921.3000001907349,"ttfb":159.5999994277954,"pageVisibility":"visible","entityId":87396,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"376f02ea-ec2f-4a93-930f-7a68f4df5cb1","navigationType":0,"readyForUser":987.8000001907349,"redirectCount":0,"resourceLoadedEnd":1124.8000001907349,"resourceLoadedStart":165.5999994277954,"resourceTiming":[{"duration":319.70000076293945,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":165.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":165.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":485.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":319.4000005722046,"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":165.89999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":165.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":485.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":328.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":165.89999961853027,"connectEnd":165.89999961853027,"connectStart":165.89999961853027,"domainLookupEnd":165.89999961853027,"domainLookupStart":165.89999961853027,"fetchStart":165.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":165.89999961853027,"responseEnd":494.5999994277954,"responseStart":494.5999994277954,"secureConnectionStart":165.89999961853027},{"duration":354.0999994277954,"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":166,"connectEnd":166,"connectStart":166,"domainLookupEnd":166,"domainLookupStart":166,"fetchStart":166,"redirectEnd":0,"redirectStart":0,"requestStart":166,"responseEnd":520.0999994277954,"responseStart":520.0999994277954,"secureConnectionStart":166},{"duration":357.69999980926514,"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":166.19999980926514,"connectEnd":166.19999980926514,"connectStart":166.19999980926514,"domainLookupEnd":166.19999980926514,"domainLookupStart":166.19999980926514,"fetchStart":166.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":166.19999980926514,"responseEnd":523.8999996185303,"responseStart":523.8999996185303,"secureConnectionStart":166.19999980926514},{"duration":358.1000003814697,"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":166.19999980926514,"connectEnd":166.19999980926514,"connectStart":166.19999980926514,"domainLookupEnd":166.19999980926514,"domainLookupStart":166.19999980926514,"fetchStart":166.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":166.19999980926514,"responseEnd":524.3000001907349,"responseStart":524.3000001907349,"secureConnectionStart":166.19999980926514},{"duration":358.9000005722046,"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":166.39999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":166.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":525.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":358.4000005722046,"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":166.39999961853027,"connectEnd":166.39999961853027,"connectStart":166.39999961853027,"domainLookupEnd":166.39999961853027,"domainLookupStart":166.39999961853027,"fetchStart":166.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":166.39999961853027,"responseEnd":524.8000001907349,"responseStart":524.8000001907349,"secureConnectionStart":166.39999961853027},{"duration":358.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":166.5,"connectEnd":166.5,"connectStart":166.5,"domainLookupEnd":166.5,"domainLookupStart":166.5,"fetchStart":166.5,"redirectEnd":0,"redirectStart":0,"requestStart":166.5,"responseEnd":525.3000001907349,"responseStart":525.3000001907349,"secureConnectionStart":166.5},{"duration":359,"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":166.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":166.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":525.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":359.0999994277954,"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":166.80000019073486,"connectEnd":166.80000019073486,"connectStart":166.80000019073486,"domainLookupEnd":166.80000019073486,"domainLookupStart":166.80000019073486,"fetchStart":166.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":166.80000019073486,"responseEnd":525.8999996185303,"responseStart":525.8999996185303,"secureConnectionStart":166.80000019073486},{"duration":558,"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":167.5,"connectEnd":167.5,"connectStart":167.5,"domainLookupEnd":167.5,"domainLookupStart":167.5,"fetchStart":167.5,"redirectEnd":0,"redirectStart":0,"requestStart":167.5,"responseEnd":725.5,"responseStart":725.5,"secureConnectionStart":167.5},{"duration":957.2000007629395,"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":167.5999994277954,"connectEnd":167.5999994277954,"connectStart":167.5999994277954,"domainLookupEnd":167.5999994277954,"domainLookupStart":167.5999994277954,"fetchStart":167.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":167.5999994277954,"responseEnd":1124.8000001907349,"responseStart":1124.8000001907349,"secureConnectionStart":167.5999994277954},{"duration":354.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":726.8000001907349,"connectEnd":726.8000001907349,"connectStart":726.8000001907349,"domainLookupEnd":726.8000001907349,"domainLookupStart":726.8000001907349,"fetchStart":726.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":726.8000001907349,"responseEnd":1081,"responseStart":1081,"secureConnectionStart":726.8000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":9,"responseStart":159,"responseEnd":160,"domLoading":163,"domInteractive":1177,"domContentLoadedEventStart":1177,"domContentLoadedEventEnd":1213,"domComplete":2027,"loadEventStart":2027,"loadEventEnd":2028,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1159.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1160.5999994277954},{"name":"bigPipe.activity-panel-pipe-id.start","time":1160.5999994277954},{"name":"bigPipe.activity-panel-pipe-id.end","time":1163},{"name":"activityTabFullyLoaded","time":1219.8000001907349}],"measures":[],"correlationId":"4be2d9374aa08f","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":91,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}