To reproduce,
- On 10.0/10.1 with all default options, run
create table t1 (a int, b int generated always as (a) persistent) engine=InnoDB;
|
- shut down the server normally;
- start 10.2+ on the same datadir;
- [optionally] run mysql_upgrade (doesn't make any difference for the failure on TRUNCATE, but see the footnote);
- run
10.4 09b2d37a
|
mysqld: /data/src/10.4/storage/innobase/handler/ha_innodb.cc:10733: bool create_table_check_doc_id_col(trx_t*, const TABLE*, ulint*): Assertion `!omits_virtual_cols(*form->s)' failed.
|
190318 20:23:53 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f410c1ccee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
|
#8 0x0000560e1fd64ec4 in create_table_check_doc_id_col (trx=0x7f4108eda390, form=0x7f409806fe80, doc_id_col=0x7f4108e3f8e8) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:10733
|
#9 0x0000560e1fd7a4f7 in create_table_info_t::create_table_def (this=0x7f4108e3fd60) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:10963
|
#10 0x0000560e1fd6744f in create_table_info_t::create_table (this=0x7f4108e3fd60, create_fk=false) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12401
|
#11 0x0000560e1fd7bcb8 in ha_innobase::create (this=0x7f40981ca5d8, name=0x7f40982f24a0 "test/t1", form=0x7f409806fe80, create_info=0x7f4108e40270, file_per_table=true, trx=0x7f4108eda390) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12719
|
#12 0x0000560e1fd68f13 in ha_innobase::truncate (this=0x7f40981ca5d8) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:13393
|
#13 0x0000560e1fa24e05 in handler::ha_truncate (this=0x7f40981ca5d8) at /data/src/10.4/sql/handler.cc:4562
|
#14 0x0000560e1f882b20 in Sql_cmd_truncate_table::handler_truncate (this=0x7f4098014a00, thd=0x7f4098000b00, table_ref=0x7f4098014358, is_tmp_table=false) at /data/src/10.4/sql/sql_truncate.cc:242
|
#15 0x0000560e1f88325a in Sql_cmd_truncate_table::truncate_table (this=0x7f4098014a00, thd=0x7f4098000b00, table_ref=0x7f4098014358) at /data/src/10.4/sql/sql_truncate.cc:450
|
#16 0x0000560e1f8833e8 in Sql_cmd_truncate_table::execute (this=0x7f4098014a00, thd=0x7f4098000b00) at /data/src/10.4/sql/sql_truncate.cc:506
|
#17 0x0000560e1f6de4dc in mysql_execute_command (thd=0x7f4098000b00) at /data/src/10.4/sql/sql_parse.cc:6394
|
#18 0x0000560e1f6e3675 in mysql_parse (thd=0x7f4098000b00, rawbuf=0x7f4098014288 "truncate table test.t1", length=22, parser_state=0x7f4108e411d0, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8205
|
#19 0x0000560e1f6ceca5 in dispatch_command (command=COM_QUERY, thd=0x7f4098000b00, packet=0x7f409801c361 "truncate table test.t1", packet_length=22, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1829
|
#20 0x0000560e1f6cd48b in do_command (thd=0x7f4098000b00) at /data/src/10.4/sql/sql_parse.cc:1358
|
#21 0x0000560e1f847387 in do_handle_one_connection (connect=0x560e23a13e90) at /data/src/10.4/sql/sql_connect.cc:1399
|
#22 0x0000560e1f8470f8 in handle_one_connection (arg=0x560e23a13e90) at /data/src/10.4/sql/sql_connect.cc:1302
|
#23 0x00007f410dea3494 in start_thread (arg=0x7f4108e42700) at pthread_create.c:333
|
#24 0x00007f410c28993f in clone () from /lib/x86_64-linux-gnu/libc.so.6
|
Footnote
If truncate table was run and crashed without previous mysql_upgrade, 10.3/10.4 refuse to start afterwards:
mysqld: /data/src/10.4/storage/innobase/row/row0undo.cc:389: bool row_undo_rec_get(undo_node_t*): Assertion `undo == update || undo == temp' failed.
|
190318 20:32:51 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007fa3b6936ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
|
#8 0x000056153f1d6025 in row_undo_rec_get (node=0x561542c2ed38) at /data/src/10.4/storage/innobase/row/row0undo.cc:389
|
#9 0x000056153f1d614e in row_undo (node=0x561542c2ed38, thr=0x561542c2eb68) at /data/src/10.4/storage/innobase/row/row0undo.cc:414
|
#10 0x000056153f1d6424 in row_undo_step (thr=0x561542c2eb68) at /data/src/10.4/storage/innobase/row/row0undo.cc:498
|
#11 0x000056153f1368b2 in que_thr_step (thr=0x561542c2eb68) at /data/src/10.4/storage/innobase/que/que0que.cc:1040
|
#12 0x000056153f136b01 in que_run_threads_low (thr=0x561542c2eb68) at /data/src/10.4/storage/innobase/que/que0que.cc:1104
|
#13 0x000056153f136cf2 in que_run_threads (thr=0x561542c2eb68) at /data/src/10.4/storage/innobase/que/que0que.cc:1144
|
#14 0x000056153f234e9c in trx_rollback_active (trx=0x7fa3a10dd140) at /data/src/10.4/storage/innobase/trx/trx0roll.cc:663
|
#15 0x000056153f23568b in trx_rollback_recovered (all=false) at /data/src/10.4/storage/innobase/trx/trx0roll.cc:819
|
#16 0x000056153f1fc395 in srv_start (create_new_db=false) at /data/src/10.4/storage/innobase/srv/srv0start.cc:2114
|
#17 0x000056153f022a58 in innodb_init (p=0x561541cd35f0) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:4285
|
#18 0x000056153ece6ed9 in ha_initialize_handlerton (plugin=0x561541cc4878) at /data/src/10.4/sql/handler.cc:531
|
#19 0x000056153e9bb92b in plugin_initialize (tmp_root=0x7ffc511e5960, plugin=0x561541cc4878, argc=0x561540226078 <remaining_argc>, argv=0x561541c61d68, options_only=false) at /data/src/10.4/sql/sql_plugin.cc:1437
|
#20 0x000056153e9bc5c0 in plugin_init (argc=0x561540226078 <remaining_argc>, argv=0x561541c61d68, flags=2) at /data/src/10.4/sql/sql_plugin.cc:1720
|
#21 0x000056153e86dbf9 in init_server_components () at /data/src/10.4/sql/mysqld.cc:5176
|
#22 0x000056153e86eddf in mysqld_main (argc=11, argv=0x561541c61d68) at /data/src/10.4/sql/mysqld.cc:5703
|
#23 0x000056153e863460 in main (argc=11, argv=0x7ffc511e63a8) at /data/src/10.4/sql/main.cc:25
|
(Possibly it's not mysql_upgrade as such that's important, but any activity before truncate).
Data directory pre-created on 10.1 cd805a5f is attached as data.tar.gz
.
{"report":{"fcp":1010,"ttfb":310.2999997138977,"pageVisibility":"visible","entityId":73352,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"a7f6b820-3e30-4d3c-b5c5-2d96d740ac4f","navigationType":0,"readyForUser":1102,"redirectCount":0,"resourceLoadedEnd":1178.5999999046326,"resourceLoadedStart":315.5,"resourceTiming":[{"duration":172.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":315.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":315.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":487.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":172.09999990463257,"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":315.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":315.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":487.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":209.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":316,"connectEnd":316,"connectStart":316,"domainLookupEnd":316,"domainLookupStart":316,"fetchStart":316,"redirectEnd":0,"redirectStart":0,"requestStart":316,"responseEnd":525.2999997138977,"responseStart":525.2999997138977,"secureConnectionStart":316},{"duration":316.19999980926514,"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":316.09999990463257,"connectEnd":316.09999990463257,"connectStart":316.09999990463257,"domainLookupEnd":316.09999990463257,"domainLookupStart":316.09999990463257,"fetchStart":316.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":316.09999990463257,"responseEnd":632.2999997138977,"responseStart":632.2999997138977,"secureConnectionStart":316.09999990463257},{"duration":320,"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":316.2999997138977,"connectEnd":316.2999997138977,"connectStart":316.2999997138977,"domainLookupEnd":316.2999997138977,"domainLookupStart":316.2999997138977,"fetchStart":316.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":316.2999997138977,"responseEnd":636.2999997138977,"responseStart":636.2999997138977,"secureConnectionStart":316.2999997138977},{"duration":320.3999996185303,"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":316.5,"connectEnd":316.5,"connectStart":316.5,"domainLookupEnd":316.5,"domainLookupStart":316.5,"fetchStart":316.5,"redirectEnd":0,"redirectStart":0,"requestStart":316.5,"responseEnd":636.8999996185303,"responseStart":636.8999996185303,"secureConnectionStart":316.5},{"duration":320.69999980926514,"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":316.69999980926514,"connectEnd":316.69999980926514,"connectStart":316.69999980926514,"domainLookupEnd":316.69999980926514,"domainLookupStart":316.69999980926514,"fetchStart":316.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":316.69999980926514,"responseEnd":637.3999996185303,"responseStart":637.3999996185303,"secureConnectionStart":316.69999980926514},{"duration":352,"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":316.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":316.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":668.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":320.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":317,"connectEnd":317,"connectStart":317,"domainLookupEnd":317,"domainLookupStart":317,"fetchStart":317,"redirectEnd":0,"redirectStart":0,"requestStart":317,"responseEnd":637.7999997138977,"responseStart":637.7999997138977,"secureConnectionStart":317},{"duration":352,"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":317.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":317.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":669.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":321.09999990463257,"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":317.2999997138977,"connectEnd":317.2999997138977,"connectStart":317.2999997138977,"domainLookupEnd":317.2999997138977,"domainLookupStart":317.2999997138977,"fetchStart":317.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":317.2999997138977,"responseEnd":638.3999996185303,"responseStart":638.3999996185303,"secureConnectionStart":317.2999997138977},{"duration":523,"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":326.19999980926514,"connectEnd":326.19999980926514,"connectStart":326.19999980926514,"domainLookupEnd":326.19999980926514,"domainLookupStart":326.19999980926514,"fetchStart":326.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":326.19999980926514,"responseEnd":849.1999998092651,"responseStart":849.0999999046326,"secureConnectionStart":326.19999980926514},{"duration":830.3000001907349,"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":326.2999997138977,"connectEnd":326.2999997138977,"connectStart":326.2999997138977,"domainLookupEnd":326.2999997138977,"domainLookupStart":326.2999997138977,"fetchStart":326.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":326.2999997138977,"responseEnd":1156.5999999046326,"responseStart":1156.5999999046326,"secureConnectionStart":326.2999997138977},{"duration":168.80000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":680.6999998092651,"connectEnd":680.6999998092651,"connectStart":680.6999998092651,"domainLookupEnd":680.6999998092651,"domainLookupStart":680.6999998092651,"fetchStart":680.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":680.6999998092651,"responseEnd":849.5,"responseStart":849.5,"secureConnectionStart":680.6999998092651},{"duration":230.2000002861023,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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&whisper-enabled=true","startTime":948.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":948.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1178.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":320.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/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&whisper-enabled=true","startTime":949.2999997138977,"connectEnd":949.2999997138977,"connectStart":949.2999997138977,"domainLookupEnd":949.2999997138977,"domainLookupStart":949.2999997138977,"fetchStart":949.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":949.2999997138977,"responseEnd":1270.1999998092651,"responseStart":1270.1999998092651,"secureConnectionStart":949.2999997138977},{"duration":327.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/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&whisper-enabled=true","startTime":949.5999999046326,"connectEnd":949.5999999046326,"connectStart":949.5999999046326,"domainLookupEnd":949.5999999046326,"domainLookupStart":949.5999999046326,"fetchStart":949.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":949.5999999046326,"responseEnd":1277.0999999046326,"responseStart":1277.0999999046326,"secureConnectionStart":949.5999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":135,"responseStart":311,"responseEnd":325,"domLoading":314,"domInteractive":1221,"domContentLoadedEventStart":1221,"domContentLoadedEventEnd":1263,"domComplete":1873,"loadEventStart":1873,"loadEventEnd":1873,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1195.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1196.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1196.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1198.5999999046326},{"name":"activityTabFullyLoaded","time":1278.6999998092651}],"measures":[],"correlationId":"5dca0655d30b6b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":111,"dbReadsTimeInMs":18,"dbConnsTimeInMs":28,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The assertion that was added in
MDEV-17199is conflicting with the TRUNCATE TABLE implementation ofMDEV-13564. Because the .frm file will not change in TRUNCATE, InnoDB must be prepared to create a table with ‘old-format’ metadata.When the failing assertion is removed, the TRUNCATE will proceed without a crash. Alas, if we define a slightly different table before upgrading, the table would fail to load after TRUNCATE:
--echo # upgrade to 10.2+
This would lead to an error message being issued to the client:
and another message being emitted to the server error log:
When it comes to the 10.3 assertion failure after the initial crash, it appears that the trx->rsegs.m_redo.undo that the TRUNCATE transaction did write before the server crashed was incorrectly recovered as trx->rsegs.m_redo.old_insert. This could be a regression that affects any upgrade to 10.3. Basically, a follow-up fix to
MDEV-12288is needed.MDEV-15912documents another such problem.