[rr 590711 6503]2021-11-23 19:16:54 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-6442a-12.ibd' with space ID 63. Another data file called ./test/t4.ibd exists with the same space ID.
[rr 590711 6581]2021-11-23 19:16:54 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-6442a-19.ibd' with space ID 65. Another data file called ./test/t2.ibd exists with the same space ID.
[rr 590711 6919]2021-11-23 19:16:55 0 [ERROR] InnoDB: Tablespace 72 was not found at ./test/t5.ibd.
[rr 590711 6923]2021-11-23 19:16:55 0 [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.
[rr 590711 6927]2021-11-23 19:16:55 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1447] with error Tablespace not found
Thirunarayanan Balathandayuthapani
added a comment - matthias reported the following issue:
pluto:/data/rqg/results/1637683377/TBR-1105/data/rqg/1637683377/102/1/rr
_RR_TRACE_DIR="." rr replay --mark-stdio mysqld-1 # Fate of DB server till SIGKILL
_RR_TRACE_DIR="." rr replay --mark-stdio mysqld-2 # Restart attempt which fails with
[rr 590711 6386]2021-11-23 19:16:54 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=50236030,53957790
[rr 590711 6503]2021-11-23 19:16:54 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-6442a-12.ibd' with space ID 63. Another data file called ./test/t4.ibd exists with the same space ID.
[rr 590711 6581]2021-11-23 19:16:54 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-6442a-19.ibd' with space ID 65. Another data file called ./test/t2.ibd exists with the same space ID.
[rr 590711 6919]2021-11-23 19:16:55 0 [ERROR] InnoDB: Tablespace 72 was not found at ./test/t5.ibd.
[rr 590711 6923]2021-11-23 19:16:55 0 [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace.
[rr 590711 6927]2021-11-23 19:16:55 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1447] with error Tablespace not found
[rr 590711 6931]2021-11-23 19:16:55 0 [Note] InnoDB: Starting shutdown...
I think there could be race condition between rename operation and fil_names_clear() written during checkpoint operation
we do write redo log for rename operation before renaming the tablespace (space->chain->start)->name
If we do checkpoint(fil_names_clear) between these 2 operation then InnoDB will try to recover the table using old_name
some like this:
lsn: 1000
mlog_file_rename 5, t1, #sql-ib183
lsn:1100
mlog_file_name 5, t1
LOG_CHECKPOINT_END_LSN is 1100
Thirunarayanan Balathandayuthapani
added a comment - I think there could be race condition between rename operation and fil_names_clear() written during checkpoint operation
we do write redo log for rename operation before renaming the tablespace (space->chain->start)->name
fil_name_write_rename(id, old_path, path);
}
return fil_rename_tablespace(id, old_path, path) ? DB_SUCCESS : DB_ERROR;
If we do checkpoint(fil_names_clear) between these 2 operation then InnoDB will try to recover the table using old_name
some like this:
lsn: 1000
mlog_file_rename 5, t1, #sql-ib183
lsn:1100
mlog_file_name 5, t1
LOG_CHECKPOINT_END_LSN is 1100
For the record, before the fix of MDEV-28870 I was able to reproduce the following failure locally:
10.6 0e4cf497ca11a7298e2bd896cb594bd52085a1d4
atomic.rename_table 'innodb' w3 [ fail ]
Test ended at 2022-06-20 11:21:37
CURRENT_TEST: atomic.rename_table
mysqltest: At line 155: query 'let $res=`select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4`' failed: ER_UNKNOWN_STORAGE_ENGINE (1286): Unknown storage engine 'InnoDB'
…
2022-06-20 11:21:36 0 [ERROR] InnoDB: Tablespace 8 was not found at ./test/t5.ibd.
2022-06-20 11:21:36 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1197] with error Tablespace not found
2022-06-20 11:21:36 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-06-20 11:21:36 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
With the fix of MDEV-28870, the test passed for 120×10 runs (on a system where nproc reports 40).
My test invocation was the following, on a debug build:
I think that innodb_max_dirty_pages_pct=0 should increase the chances of hitting the MDEV-28870 scenario, that is, a race condition between log checkpoint and processing FILE_RENAME or FILE_DELETE.
Marko Mäkelä
added a comment - For the record, before the fix of MDEV-28870 I was able to reproduce the following failure locally:
10.6 0e4cf497ca11a7298e2bd896cb594bd52085a1d4
atomic.rename_table 'innodb' w3 [ fail ]
Test ended at 2022-06-20 11:21:37
CURRENT_TEST: atomic.rename_table
mysqltest: At line 155: query 'let $res=`select t1.a+t2.b+t3.c+t4.d from t1,t2,t3,t4`' failed: ER_UNKNOWN_STORAGE_ENGINE (1286): Unknown storage engine 'InnoDB'
…
2022-06-20 11:21:36 0 [ERROR] InnoDB: Tablespace 8 was not found at ./test/t5.ibd.
2022-06-20 11:21:36 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1197] with error Tablespace not found
2022-06-20 11:21:36 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-06-20 11:21:36 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
With the fix of MDEV-28870 , the test passed for 120×10 runs (on a system where nproc reports 40).
My test invocation was the following, on a debug build:
nice . /mtr --mysqld=--innodb-max-dirty-pages-pct=0 --repeat=10 --parallel=120 atomic.rename_table{,,,,,,,,,,,,,,,,,,,}{,,,,,}
I think that innodb_max_dirty_pages_pct=0 should increase the chances of hitting the MDEV-28870 scenario, that is, a race condition between log checkpoint and processing FILE_RENAME or FILE_DELETE .
People
Marko Mäkelä
Thirunarayanan Balathandayuthapani
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":867.1000003814697,"ttfb":247.30000019073486,"pageVisibility":"visible","entityId":105526,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"422337f8-2be3-41fa-9e8a-e8ef0cec5cca","navigationType":0,"readyForUser":939.8000001907349,"redirectCount":0,"resourceLoadedEnd":603.9000005722046,"resourceLoadedStart":255.69999980926514,"resourceTiming":[{"duration":11.200000762939453,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":255.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":255.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":266.9000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":12,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":268,"responseStart":0,"secureConnectionStart":0},{"duration":211.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":256.30000019073486,"connectEnd":269.6000003814697,"connectStart":269.6000003814697,"domainLookupEnd":269.6000003814697,"domainLookupStart":269.6000003814697,"fetchStart":256.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":269.80000019073486,"responseEnd":468,"responseStart":282.69999980926514,"secureConnectionStart":269.6000003814697},{"duration":347,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":256.9000005722046,"connectEnd":256.9000005722046,"connectStart":256.9000005722046,"domainLookupEnd":256.9000005722046,"domainLookupStart":256.9000005722046,"fetchStart":256.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":271.19999980926514,"responseEnd":603.9000005722046,"responseStart":286.4000005722046,"secureConnectionStart":256.9000005722046},{"duration":42.30000019073486,"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":257.1000003814697,"connectEnd":257.1000003814697,"connectStart":257.1000003814697,"domainLookupEnd":257.1000003814697,"domainLookupStart":257.1000003814697,"fetchStart":257.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":275.80000019073486,"responseEnd":299.4000005722046,"responseStart":296.9000005722046,"secureConnectionStart":257.1000003814697},{"duration":45.5,"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":257.4000005722046,"connectEnd":257.4000005722046,"connectStart":257.4000005722046,"domainLookupEnd":257.4000005722046,"domainLookupStart":257.4000005722046,"fetchStart":257.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":277.19999980926514,"responseEnd":302.9000005722046,"responseStart":300.30000019073486,"secureConnectionStart":257.4000005722046},{"duration":53.80000019073486,"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":257.5,"connectEnd":257.5,"connectStart":257.5,"domainLookupEnd":257.5,"domainLookupStart":257.5,"fetchStart":257.5,"redirectEnd":0,"redirectStart":0,"requestStart":278.1000003814697,"responseEnd":311.30000019073486,"responseStart":307.80000019073486,"secureConnectionStart":257.5},{"duration":16.199999809265137,"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":257.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":257.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":273.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":53.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":257.80000019073486,"connectEnd":257.80000019073486,"connectStart":257.80000019073486,"domainLookupEnd":257.80000019073486,"domainLookupStart":257.80000019073486,"fetchStart":257.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":278.19999980926514,"responseEnd":311.6000003814697,"responseStart":308.5,"secureConnectionStart":257.80000019073486},{"duration":18.09999942779541,"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":258.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":258.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":276.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":48.80000019073486,"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":258.30000019073486,"connectEnd":258.30000019073486,"connectStart":258.30000019073486,"domainLookupEnd":258.30000019073486,"domainLookupStart":258.30000019073486,"fetchStart":258.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":278.30000019073486,"responseEnd":307.1000003814697,"responseStart":302,"secureConnectionStart":258.30000019073486},{"duration":287.3999996185303,"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":260.30000019073486,"connectEnd":260.30000019073486,"connectStart":260.30000019073486,"domainLookupEnd":260.30000019073486,"domainLookupStart":260.30000019073486,"fetchStart":260.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":315.5,"responseEnd":547.6999998092651,"responseStart":541.5,"secureConnectionStart":260.30000019073486},{"duration":285.8999996185303,"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":262.1000003814697,"connectEnd":262.1000003814697,"connectStart":262.1000003814697,"domainLookupEnd":262.1000003814697,"domainLookupStart":262.1000003814697,"fetchStart":262.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":315.69999980926514,"responseEnd":548,"responseStart":542.1999998092651,"secureConnectionStart":262.1000003814697},{"duration":170.39999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":612.6000003814697,"connectEnd":612.6000003814697,"connectStart":612.6000003814697,"domainLookupEnd":612.6000003814697,"domainLookupStart":612.6000003814697,"fetchStart":612.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":743.6999998092651,"responseEnd":783,"responseStart":781.4000005722046,"secureConnectionStart":612.6000003814697},{"duration":173.10000038146973,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":823.5,"connectEnd":823.5,"connectStart":823.5,"domainLookupEnd":823.5,"domainLookupStart":823.5,"fetchStart":823.5,"redirectEnd":0,"redirectStart":0,"requestStart":962.9000005722046,"responseEnd":996.6000003814697,"responseStart":995.6000003814697,"secureConnectionStart":823.5},{"duration":186.29999923706055,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":860.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":860.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1047.1999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":18,"domainLookupEnd":37,"connectStart":37,"connectEnd":56,"secureConnectionStart":45,"requestStart":57,"responseStart":247,"responseEnd":261,"domLoading":250,"domInteractive":1057,"domContentLoadedEventStart":1057,"domContentLoadedEventEnd":1114,"domComplete":1410,"loadEventStart":1410,"loadEventEnd":1410,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1011.6000003814697},{"name":"bigPipe.sidebar-id.end","time":1012.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1012.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1015.6000003814697},{"name":"activityTabFullyLoaded","time":1130}],"measures":[],"correlationId":"9f027eebf989d9","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":111,"dbReadsTimeInMs":20,"dbConnsTimeInMs":29,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Patch is in bb-10.6-
MDEV-27111