If CREATE OR REPLACE, executed under lock, fails in the process, it keeps MDL_EXCLUSIVE lock on the table it attempted to re-create. It might happen both when the drop part fails, or when the create part fails (in the latter case, the connection holds a lock for a non-existing table).
After it happens, the connection itself does not realize it keeps the lock, and cannot use it any longer.
UNLOCK solves the problem, so it's not critical.
Example 1: failure upon creation.
We lock the table, attempt to re-create it, it gets dropped but not created; we still have MDL_EXCLUSIVE for it, but cannot create it until UNLOCK.
MariaDB [db]> createtable t1 (i int);
Query OK, 0 rows affected (0.59 sec)
MariaDB [db]> lock table t1 write;
Query OK, 0 rows affected (0.00 sec)
MariaDB [db]> select * from information_schema.metadata_lock_info;
ERROR 1100 (HY000): Table't1' was not locked with LOCK TABLES
MariaDB [db]> unlock tables;
Query OK, 0 rows affected (0.00 sec)
MariaDB [db]> select * from information_schema.metadata_lock_info;
Empty set (0.00 sec)
Example 2: failure upon drop.
We lock the table, attempt to re-create it, it does not get dropped; we still have MDL_EXCLUSIVE for it, but cannot read from it.
MariaDB [db]> createtable t1 (a int, index(a)) engine=InnoDB;
Fixed by releasing meta data locks and doing automatic UNLOCK TABLE if there are no more locked tables after table was dropped.
Michael Widenius
added a comment - Fixed by releasing meta data locks and doing automatic UNLOCK TABLE if there are no more locked tables after table was dropped.
People
Michael Widenius
Elena Stepanova
Votes:
0Vote for this issue
Watchers:
3Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":857.7000007629395,"ttfb":230.70000076293945,"pageVisibility":"visible","entityId":30404,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"b1d72358-fc63-4754-8d10-55bb141411ea","navigationType":0,"readyForUser":948.8000011444092,"redirectCount":0,"resourceLoadedEnd":596.8000011444092,"resourceLoadedStart":237.20000076293945,"resourceTiming":[{"duration":13.399999618530273,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":237.20000076293945,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":237.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":250.60000038146973,"responseStart":0,"secureConnectionStart":0},{"duration":14.700000762939453,"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":237.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":237.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":252.20000076293945,"responseStart":0,"secureConnectionStart":0},{"duration":209.10000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":237.60000038146973,"connectEnd":237.60000038146973,"connectStart":237.60000038146973,"domainLookupEnd":237.60000038146973,"domainLookupStart":237.60000038146973,"fetchStart":237.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":254.80000114440918,"responseEnd":446.70000076293945,"responseStart":284.6000003814697,"secureConnectionStart":237.60000038146973},{"duration":359,"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":237.80000114440918,"connectEnd":237.80000114440918,"connectStart":237.80000114440918,"domainLookupEnd":237.80000114440918,"domainLookupStart":237.80000114440918,"fetchStart":237.80000114440918,"redirectEnd":0,"redirectStart":0,"requestStart":255,"responseEnd":596.8000011444092,"responseStart":290.8000011444092,"secureConnectionStart":237.80000114440918},{"duration":56.80000114440918,"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":237.89999961853027,"connectEnd":237.89999961853027,"connectStart":237.89999961853027,"domainLookupEnd":237.89999961853027,"domainLookupStart":237.89999961853027,"fetchStart":237.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":255.89999961853027,"responseEnd":294.70000076293945,"responseStart":292.5,"secureConnectionStart":237.89999961853027},{"duration":56.79999923706055,"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":238.10000038146973,"connectEnd":238.10000038146973,"connectStart":238.10000038146973,"domainLookupEnd":238.10000038146973,"domainLookupStart":238.10000038146973,"fetchStart":238.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":256.3000011444092,"responseEnd":294.8999996185303,"responseStart":293.20000076293945,"secureConnectionStart":238.10000038146973},{"duration":59.39999961853027,"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":238.10000038146973,"connectEnd":238.10000038146973,"connectStart":238.10000038146973,"domainLookupEnd":238.10000038146973,"domainLookupStart":238.10000038146973,"fetchStart":238.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":265.70000076293945,"responseEnd":297.5,"responseStart":296.20000076293945,"secureConnectionStart":238.10000038146973},{"duration":18.299999237060547,"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":238.30000114440918,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":238.30000114440918,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":256.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":20.700000762939453,"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":238.39999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":238.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":259.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":61.80000114440918,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":238.39999961853027,"connectEnd":238.39999961853027,"connectStart":238.39999961853027,"domainLookupEnd":238.39999961853027,"domainLookupStart":238.39999961853027,"fetchStart":238.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":266.3000011444092,"responseEnd":300.20000076293945,"responseStart":298.20000076293945,"secureConnectionStart":238.39999961853027},{"duration":62.20000076293945,"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":238.5,"connectEnd":238.5,"connectStart":238.5,"domainLookupEnd":238.5,"domainLookupStart":238.5,"fetchStart":238.5,"redirectEnd":0,"redirectStart":0,"requestStart":269.6000003814697,"responseEnd":300.70000076293945,"responseStart":299.3000011444092,"secureConnectionStart":238.5},{"duration":298.5,"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":246.70000076293945,"connectEnd":246.70000076293945,"connectStart":246.70000076293945,"domainLookupEnd":246.70000076293945,"domainLookupStart":246.70000076293945,"fetchStart":246.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":282.8000011444092,"responseEnd":545.2000007629395,"responseStart":540.8000011444092,"secureConnectionStart":246.70000076293945},{"duration":298.6999988555908,"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":246.70000076293945,"connectEnd":246.70000076293945,"connectStart":246.70000076293945,"domainLookupEnd":246.70000076293945,"domainLookupStart":246.70000076293945,"fetchStart":246.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":283.8999996185303,"responseEnd":545.3999996185303,"responseStart":541.6000003814697,"secureConnectionStart":246.70000076293945},{"duration":108.0999984741211,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":588.8000011444092,"connectEnd":588.8000011444092,"connectStart":588.8000011444092,"domainLookupEnd":588.8000011444092,"domainLookupStart":588.8000011444092,"fetchStart":588.8000011444092,"redirectEnd":0,"redirectStart":0,"requestStart":663,"responseEnd":696.8999996185303,"responseStart":695.5,"secureConnectionStart":588.8000011444092},{"duration":141.39999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":812.7000007629395,"connectEnd":812.7000007629395,"connectStart":812.7000007629395,"domainLookupEnd":812.7000007629395,"domainLookupStart":812.7000007629395,"fetchStart":812.7000007629395,"redirectEnd":0,"redirectStart":0,"requestStart":917,"responseEnd":954.1000003814697,"responseStart":952.8999996185303,"secureConnectionStart":812.7000007629395},{"duration":75.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":849.2000007629395,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":849.2000007629395,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":924.7000007629395,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":41,"responseStart":230,"responseEnd":246,"domLoading":234,"domInteractive":1054,"domContentLoadedEventStart":1054,"domContentLoadedEventEnd":1110,"domComplete":1442,"loadEventStart":1442,"loadEventEnd":1442,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1036.7000007629395},{"name":"bigPipe.sidebar-id.end","time":1037.3999996185303},{"name":"bigPipe.activity-panel-pipe-id.start","time":1037.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":1038.5},{"name":"activityTabFullyLoaded","time":1123.3000011444092}],"measures":[],"correlationId":"bece103e024710","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":69,"dbReadsTimeInMs":9,"dbConnsTimeInMs":16,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Fixed by releasing meta data locks and doing automatic UNLOCK TABLE if there are no more locked tables after table was dropped.