Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.0(EOL) , 10.1(EOL) , 10.2(EOL) , 10.3(EOL) , 10.4(EOL) , 10.5
I happened to get this crash today once on a 10.5-based branch.
10.5
CURRENT_TEST: innodb.innodb-wl5522-debug
mysqltest: At line 1138: query 'ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE' failed: 2013: Lost connection to MySQL server during query
…
2020-01-21 15:20:37 3 [Note] InnoDB: Phase IV - Flush complete
2020-01-21 15:20:37 3 [Note] InnoDB: `test_wl5522`.`t1` autoinc value set to 248
2020-01-21 15:20:37 0x7f10499c9700 InnoDB: Assertion failure in file /mariadb/10.5-MDEV-12353/storage/innobase/btr/btr0btr.cc line 204
InnoDB: Failing assertion: mach_read_from_4(seg_header + FSEG_HDR_SPACE) == space
…
#6 0x00005599e08d7f49 in btr_root_block_get (index=0x7f101c0e9c88, mode=<optimized out>, mtr=<optimized out>) at /mariadb/10.5-MDEV-12353/storage/innobase/btr/btr0btr.cc:243
#7 0x00005599e08d7f8e in btr_root_get (index=0x2, mtr=0x0) at /mariadb/10.5-MDEV-12353/storage/innobase/btr/btr0btr.cc:271
#8 0x00005599e0903b90 in btr_cur_instant_init_low (index=<optimized out>, mtr=0x7f10499c5f90) at /mariadb/10.5-MDEV-12353/storage/innobase/btr/btr0cur.cc:409
#9 btr_cur_instant_init (table=<optimized out>) at /mariadb/10.5-MDEV-12353/storage/innobase/btr/btr0cur.cc:662
#10 0x00005599e09bfaea in dict_load_table_one (name=..., ignore_err=<optimized out>, fk_tables=...) at /mariadb/10.5-MDEV-12353/storage/innobase/dict/dict0load.cc:3011
#11 0x00005599e09bd4ae in dict_load_table (name=0x7f101c071518 "test_wl5522/t1", ignore_err=DICT_ERR_IGNORE_FK_NOKEY) at /mariadb/10.5-MDEV-12353/storage/innobase/dict/dict0load.cc:2742
#12 0x00005599e09c0e0f in dict_load_table_on_id (table_id=<optimized out>, ignore_err=<optimized out>) at /mariadb/10.5-MDEV-12353/storage/innobase/dict/dict0load.cc:3179
#13 0x00005599e09a439f in dict_table_open_on_id_low (table_id=86, ignore_err=1234983936, cached_only=<optimized out>) at /mariadb/10.5-MDEV-12353/storage/innobase/dict/dict0dict.cc:225
#14 dict_table_open_on_id (table_id=86, dict_locked=true, table_op=DICT_TABLE_OP_NORMAL, thd=0x0, mdl=0x0) at /mariadb/10.5-MDEV-12353/storage/innobase/dict/dict0dict.cc:933
#15 0x00005599e06999dc in ha_innobase::discard_or_import_tablespace (this=0x7f101c11a520, discard=<optimized out>) at /mariadb/10.5-MDEV-12353/storage/innobase/handler/ha_innodb.cc:13396
#16 0x00005599e01c1d1e in mysql_discard_or_import_tablespace (thd=0x7f101c000cf8, table_list=0x7f101c014c98, discard=false) at /mariadb/10.5-MDEV-12353/sql/sql_table.cc:5972
#17 0x00005599e023f2ab in Sql_cmd_discard_import_tablespace::execute (this=0x7f101c015358, thd=0x7f101c000cf8) at /mariadb/10.5-MDEV-12353/sql/sql_alter.cc:559
#18 0x00005599e010a8ac in mysql_execute_command (thd=0x7f101c000cf8) at /mariadb/10.5-MDEV-12353/sql/sql_parse.cc:5959
#19 0x00005599e0105818 in mysql_parse (thd=0x7f101c000cf8, rawbuf=0x7f101c014b80 "ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE", length=<optimized out>, parser_state=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /mariadb/10.5-MDEV-12353/sql/sql_parse.cc:7988
The following code was added to ha_innobase::discard_or_import_tablespace() in MDEV-18295 :
/* Evict and reload the table definition in order to invoke
btr_cur_instant_init(). */
table_id_t id = m_prebuilt->table->id;
ut_ad(id);
mutex_enter(&dict_sys->mutex);
dict_table_close(m_prebuilt->table, TRUE, FALSE);
dict_table_remove_from_cache(m_prebuilt->table);
m_prebuilt->table = dict_table_open_on_id(id, TRUE,
DICT_TABLE_OP_NORMAL);
I believe that the check called by btr_cur_instant_init_low() must be relaxed. It is a hard assertion, affecting non-debug builds as well, because UNIV_BTR_DEBUG is always enabled. That is why I am setting this to Critical.
We should not crash, but return a failure to the caller of btr_cur_instant_init_low() . This may require specializing the btr_root_get() call.
Furthermore, when opening the table during IMPORT TABLESPACE , we must either suppress the tablespace ID validation, or we should temporarily set table->space_id to the ID that is present in the tablespace file.
Last but not least, during IMPORT TABLESPACE , the call to btr_cur_instant_init_low() must not fetch an older page from the buffer pool (it might be there after DISCARD TABLESPACE ), but actually read the page from the file. See also the related 10.4+ bug MDEV-18543 .
Transition
Time In Source Status
Execution Times
Open
Closed
58d 21h 41m
1
{"report":{"fcp":1099.4000000953674,"ttfb":322.69999980926514,"pageVisibility":"visible","entityId":82534,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"361156ff-37f4-48ba-ae6f-131ebe130680","navigationType":0,"readyForUser":1187,"redirectCount":0,"resourceLoadedEnd":1556.5999999046326,"resourceLoadedStart":327.7999997138977,"resourceTiming":[{"duration":291,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":327.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":327.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":618.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":291,"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":328.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":328.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":619.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":300.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":328.40000009536743,"connectEnd":328.40000009536743,"connectStart":328.40000009536743,"domainLookupEnd":328.40000009536743,"domainLookupStart":328.40000009536743,"fetchStart":328.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":328.40000009536743,"responseEnd":628.5999999046326,"responseStart":628.5999999046326,"secureConnectionStart":328.40000009536743},{"duration":435.09999990463257,"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":328.59999990463257,"connectEnd":328.59999990463257,"connectStart":328.59999990463257,"domainLookupEnd":328.59999990463257,"domainLookupStart":328.59999990463257,"fetchStart":328.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":328.59999990463257,"responseEnd":763.6999998092651,"responseStart":763.6999998092651,"secureConnectionStart":328.59999990463257},{"duration":438.80000019073486,"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":328.69999980926514,"connectEnd":328.69999980926514,"connectStart":328.69999980926514,"domainLookupEnd":328.69999980926514,"domainLookupStart":328.69999980926514,"fetchStart":328.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":328.69999980926514,"responseEnd":767.5,"responseStart":767.5,"secureConnectionStart":328.69999980926514},{"duration":439,"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":329,"connectEnd":329,"connectStart":329,"domainLookupEnd":329,"domainLookupStart":329,"fetchStart":329,"redirectEnd":0,"redirectStart":0,"requestStart":329,"responseEnd":768,"responseStart":768,"secureConnectionStart":329},{"duration":439.30000019073486,"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":329.09999990463257,"connectEnd":329.09999990463257,"connectStart":329.09999990463257,"domainLookupEnd":329.09999990463257,"domainLookupStart":329.09999990463257,"fetchStart":329.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":329.09999990463257,"responseEnd":768.4000000953674,"responseStart":768.4000000953674,"secureConnectionStart":329.09999990463257},{"duration":444.6000003814697,"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":329.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":329.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":773.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":439.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":329.5,"connectEnd":329.5,"connectStart":329.5,"domainLookupEnd":329.5,"domainLookupStart":329.5,"fetchStart":329.5,"redirectEnd":0,"redirectStart":0,"requestStart":329.5,"responseEnd":768.7999997138977,"responseStart":768.7999997138977,"secureConnectionStart":329.5},{"duration":444.40000009536743,"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":329.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":329.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":774,"responseStart":0,"secureConnectionStart":0},{"duration":439.59999990463257,"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":329.90000009536743,"connectEnd":329.90000009536743,"connectStart":329.90000009536743,"domainLookupEnd":329.90000009536743,"domainLookupStart":329.90000009536743,"fetchStart":329.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":329.90000009536743,"responseEnd":769.5,"responseStart":769.5,"secureConnectionStart":329.90000009536743},{"duration":963.6999998092651,"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":336.09999990463257,"connectEnd":336.09999990463257,"connectStart":336.09999990463257,"domainLookupEnd":336.09999990463257,"domainLookupStart":336.09999990463257,"fetchStart":336.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":336.09999990463257,"responseEnd":1299.7999997138977,"responseStart":1299.7999997138977,"secureConnectionStart":336.09999990463257},{"duration":1220.5,"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":336.09999990463257,"connectEnd":336.09999990463257,"connectStart":336.09999990463257,"domainLookupEnd":336.09999990463257,"domainLookupStart":336.09999990463257,"fetchStart":336.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":336.09999990463257,"responseEnd":1556.5999999046326,"responseStart":1556.5999999046326,"secureConnectionStart":336.09999990463257},{"duration":517.8000001907349,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":786.0999999046326,"connectEnd":786.0999999046326,"connectStart":786.0999999046326,"domainLookupEnd":786.0999999046326,"domainLookupStart":786.0999999046326,"fetchStart":786.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":786.0999999046326,"responseEnd":1303.9000000953674,"responseStart":1303.9000000953674,"secureConnectionStart":786.0999999046326},{"duration":509.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1092.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1092.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1601.7999997138977,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":142,"responseStart":323,"responseEnd":334,"domLoading":326,"domInteractive":1603,"domContentLoadedEventStart":1603,"domContentLoadedEventEnd":1656,"domComplete":2038,"loadEventStart":2038,"loadEventEnd":2038,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1559},{"name":"bigPipe.sidebar-id.end","time":1559.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1560.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1561},{"name":"activityTabFullyLoaded","time":1668.0999999046326}],"measures":[],"correlationId":"418b31ffc83f77","effectiveType":"4g","downlink":9.7,"rtt":0,"serverDuration":119,"dbReadsTimeInMs":29,"dbConnsTimeInMs":40,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}