Before MariaDB 10.2.2 or MySQL 5.7.5, the server should always start up, but it could fail to find the table:
Version: '10.2.11-MariaDB-debug-log' socket: '/mariadb/10.2/build/mysql-test/var/tmp/mysqld.1.sock' port: 16000 Source distribution
2017-12-20 12:37:45 140491764602624 [ERROR] InnoDB: Failed to find tablespace for table `test`.`t1` in the cache. Attempting to load the tablespace with space id 4
2017-12-20 12:37:45 140491764602624 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2017-12-20 12:37:45 140491764602624 [ERROR] InnoDB: The error means the system cannot find the path specified.
2017-12-20 12:37:45 140491764602624 [ERROR] InnoDB: Cannot open datafile for read-only: './test/t1.ibd' OS error: 71
2017-12-20 12:37:45 140491764602624 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2017-12-20 12:37:45 140491764602624 [ERROR] InnoDB: The error means the system cannot find the path specified.
2017-12-20 12:37:45 140491764602624 [ERROR] InnoDB: Could not find a valid tablespace file for `test/t1`. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
Both problems can be reproduced with the following instrumentation:
CREATETABLE t1 (a INT UNSIGNED PRIMARYKEY) ENGINE=InnoDB;
INSERTINTO t1 VALUES(42);
--source include/restart_mysqld.inc
--connect (con1,localhost,root,,test)
SET DEBUG_SYNC='before_rename_table_commit SIGNAL renamed WAIT_FOR ever';
--send
RENAME TABLE t1 TO t2;
--connection default
SET DEBUG_SYNC='now WAIT_FOR renamed';
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
--disconnect con1
SELECT * FROM t1;
DROPTABLE t1;
Remove the first invocation of restart_mysqld.inc to reproduce the failure to startup.
(In the unlikely event that a log checkpoint occurs between the INSERT and the next restart_mysqld.inc, InnoDB would still be able to start up.)
How to fix this?
Always write MLOG_FILE_RENAME2 records before renaming any .ibd files. Currently it may be the case that these records are only written during ALTER TABLE…ALGORITHM=INPLACE when the rebuilt table is being swapped.
Before writing the MLOG_FILE_RENAME2 record, write a new type of an undo log record, so that in case the data dictionary transaction is rolled back, the file will be renamed back too.
How to work around the bug? While the server is offline, manually rename the .ibd files back so that they match the data dictionary (and in this case, the .frm files).
If we introduced a new undo log record type in a GA version of MariaDB, this could prevent a downgrade to an earlier GA version and violate our compatibility rules.
If we started writing MLOG_FILE_RENAME2 redo log records in MariaDB 10.2, then users should not see InnoDB startup failures related to this, but instead they would encounter missing tables. If there was any incomplete transaction that operated on the table, the rollback of that recovered transaction would skip and thus corrupt the table. The status quo would seem better: a startup after manually renaming the .ibd file back should succeed.
Attachments
Issue Links
blocks
MDEV-372Table gets fatally corrupted if server crashes during ALTER TABLE, "table doesn't exist" is reported
Closed
MDEV-13564TRUNCATE TABLE and undo tablespace truncation are not compatible with Mariabackup
Closed
causes
MDEV-17939Assertion `++loop_count < 2' failed in trx_undo_report_rename
Closed
MDEV-24184InnoDB RENAME TABLE recovery failure if names are reused
Closed
is part of
MDEV-14585Automatically remove #sql- tables in innodb dictionary during recovery
After I implemented MLOG_FILE_RENAME2 redo logging of all .ibd file rename operations, I ran into a different problem on ha_innobase::open():
2017-12-20 14:20:25 0x7fa6269d5700 InnoDB: Assertion failure in file /mariadb/10.2-ext/storage/innobase/dict/dict0dict.cc line 1318
InnoDB: Failing assertion: table2 == NULL
I then proceeded to revert what looks like a work-around: removing the parameters adjust_space, table_id from fil_space_for_table_exists_in_mem(). It did not make any difference.
The cause of this assertion failure is that at startup, before rolling back any transactions, the table was loaded into the data dictionary with the new name. That is, InnoDB essentially performed READ UNCOMMITTED of SYS_TABLES here:
at /mariadb/10.2-ext/storage/innobase/include/dict0priv.ic:90
#5 0x000055555780e780 in dict_table_open_on_id (table_id=19, dict_locked=0,
table_op=DICT_TABLE_OP_LOAD_TABLESPACE)
at /mariadb/10.2-ext/storage/innobase/dict/dict0dict.cc:1006
#6 0x000055555763ae19 in trx_resurrect_table_locks (trx=0x7fffec522078,
undo_ptr=0x7fffec5223a0, undo=0x612000022540)
at /mariadb/10.2-ext/storage/innobase/trx/trx0trx.cc:780
#7 0x000055555763d1eb in trx_lists_init_at_db_start ()
at /mariadb/10.2-ext/storage/innobase/trx/trx0trx.cc:1022
#8 0x000055555762e3df in trx_sys_init_at_db_start ()
at /mariadb/10.2-ext/storage/innobase/trx/trx0sys.cc:507
Later, after the incomplete data dictionary transaction was rolled back, on ha_innobase::open() for executing the SELECT, the table would be loaded with the correct name. But, a table with the same ID already existed in the cache, and the assertion fails.
It looks like we should always write an undo log record about RENAME TABLE, so that the cache can be adjusted on rollback.
Marko Mäkelä
added a comment - After I implemented MLOG_FILE_RENAME2 redo logging of all .ibd file rename operations, I ran into a different problem on ha_innobase::open() :
2017-12-20 14:20:25 0x7fa6269d5700 InnoDB: Assertion failure in file /mariadb/10.2-ext/storage/innobase/dict/dict0dict.cc line 1318
InnoDB: Failing assertion: table2 == NULL
I then proceeded to revert what looks like a work-around: removing the parameters adjust_space, table_id from fil_space_for_table_exists_in_mem() . It did not make any difference.
The cause of this assertion failure is that at startup, before rolling back any transactions, the table was loaded into the data dictionary with the new name. That is, InnoDB essentially performed READ UNCOMMITTED of SYS_TABLES here:
#0 dict_table_add_to_cache (table=0x61700000a588, can_be_evicted=true,
heap=0x62c000000200)
at /mariadb/10.2-ext/storage/innobase/dict/dict0dict.cc:1285
#1 0x0000555557859b7a in dict_load_table_one (name=..., cached=true,
ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK,
fk_tables=std::deque with 0 elements)
at /mariadb/10.2-ext/storage/innobase/dict/dict0load.cc:3007
#2 0x0000555557858386 in dict_load_table (name=0x614000003728 "test/t2",
cached=true, ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK)
at /mariadb/10.2-ext/storage/innobase/dict/dict0load.cc:2805
#3 0x000055555785b29a in dict_load_table_on_id (table_id=19,
ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK)
at /mariadb/10.2-ext/storage/innobase/dict/dict0load.cc:3214
#4 0x000055555780822c in dict_table_open_on_id_low (table_id=19,
ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK, open_only_if_in_cache=0)
at /mariadb/10.2-ext/storage/innobase/include/dict0priv.ic:90
#5 0x000055555780e780 in dict_table_open_on_id (table_id=19, dict_locked=0,
table_op=DICT_TABLE_OP_LOAD_TABLESPACE)
at /mariadb/10.2-ext/storage/innobase/dict/dict0dict.cc:1006
#6 0x000055555763ae19 in trx_resurrect_table_locks (trx=0x7fffec522078,
undo_ptr=0x7fffec5223a0, undo=0x612000022540)
at /mariadb/10.2-ext/storage/innobase/trx/trx0trx.cc:780
#7 0x000055555763d1eb in trx_lists_init_at_db_start ()
at /mariadb/10.2-ext/storage/innobase/trx/trx0trx.cc:1022
#8 0x000055555762e3df in trx_sys_init_at_db_start ()
at /mariadb/10.2-ext/storage/innobase/trx/trx0sys.cc:507
Later, after the incomplete data dictionary transaction was rolled back, on ha_innobase::open() for executing the SELECT , the table would be loaded with the correct name. But, a table with the same ID already existed in the cache, and the assertion fails.
It looks like we should always write an undo log record about RENAME TABLE , so that the cache can be adjusted on rollback.
While testing MDEV-13564, which implements TRUNCATE TABLE on top of crash-safe InnoDB-internal RENAME TABLE, CREATE TABLE, DROP TABLE, I suspected that I forgot a redo log flush in trx_undo_report_rename(). This would sometimes have the effect that if the server is killed during an operation that renames .ibd files, recovery would not find anything in the undo log, and would fail to roll back the rename operation in the file system.
Edit: There is nothing wrong with trx_undo_report_rename(). The redo log flush is initiated in each caller of fil_name_write_rename_low().
There is also nothing wrong with the redo log flushing:
log_write_up_to(mtr.commit_lsn(), true);
The problem that I observed in MDEV-13564 was due to unwanted COMMIT within the TRUNCATE operation.
Marko Mäkelä
added a comment - - edited While testing MDEV-13564 , which implements TRUNCATE TABLE on top of crash-safe InnoDB-internal RENAME TABLE , CREATE TABLE , DROP TABLE , I suspected that I forgot a redo log flush in trx_undo_report_rename() . This would sometimes have the effect that if the server is killed during an operation that renames .ibd files, recovery would not find anything in the undo log, and would fail to roll back the rename operation in the file system.
Edit: There is nothing wrong with trx_undo_report_rename() . The redo log flush is initiated in each caller of fil_name_write_rename_low() .
There is also nothing wrong with the redo log flushing:
log_write_up_to(mtr.commit_lsn(), true );
The problem that I observed in MDEV-13564 was due to unwanted COMMIT within the TRUNCATE operation.
I filed MDEV-17158 for this problem.
In MariaDB 10.2, this fix will remain disabled by default, in order to preserve compatibility with third-party tools.
To enable, set
loose_innodb_safe_truncate=ON
in the server configuration or add
--loose-innodb-safe-truncate
to the mysqld invocation. This option will only be available in the MariaDB Server 10.2 series.
The reason for this is that the crash-safe rename will require an undo log format change, and we can only change the undo log format by making sure that older versions of MariaDB 10.2 will refuse to start after a crash. This redo log format identifier change could cause some third-party tools to fail.
Marko Mäkelä
added a comment - - edited In MariaDB 10.2, this fix will remain disabled by default, in order to preserve compatibility with third-party tools.
To enable, set
loose_innodb_safe_truncate=ON
in the server configuration or add
--loose-innodb-safe-truncate
to the mysqld invocation. This option will only be available in the MariaDB Server 10.2 series.
The reason for this is that the crash-safe rename will require an undo log format change, and we can only change the undo log format by making sure that older versions of MariaDB 10.2 will refuse to start after a crash. This redo log format identifier change could cause some third-party tools to fail.
While renaming tables inside InnoDB should be safe in the event the server process crashes, renaming the files might not be safe when file system recovery is involved. MDEV-20677 was filed to cover those scenarios.
Marko Mäkelä
added a comment - While renaming tables inside InnoDB should be safe in the event the server process crashes, renaming the files might not be safe when file system recovery is involved. MDEV-20677 was filed to cover those scenarios.
People
Marko Mäkelä
Marko Mäkelä
Votes:
0Vote for this issue
Watchers:
2Start 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":1282.4000005722046,"ttfb":346.6000003814697,"pageVisibility":"visible","entityId":64928,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"be542bf3-4c65-4f8f-a883-b6742491007d","navigationType":0,"readyForUser":1379.1999998092651,"redirectCount":0,"resourceLoadedEnd":1009.8000001907349,"resourceLoadedStart":353.9000005722046,"resourceTiming":[{"duration":135.89999961853027,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":353.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":353.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":489.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":138.30000019073486,"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":354.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":354.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":492.4000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":503.79999923706055,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":354.4000005722046,"connectEnd":354.4000005722046,"connectStart":354.4000005722046,"domainLookupEnd":354.4000005722046,"domainLookupStart":354.4000005722046,"fetchStart":354.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":498.4000005722046,"responseEnd":858.1999998092651,"responseStart":523.6000003814697,"secureConnectionStart":354.4000005722046},{"duration":635.1999998092651,"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":354.5,"connectEnd":354.5,"connectStart":354.5,"domainLookupEnd":354.5,"domainLookupStart":354.5,"fetchStart":354.5,"redirectEnd":0,"redirectStart":0,"requestStart":494.30000019073486,"responseEnd":989.6999998092651,"responseStart":571.9000005722046,"secureConnectionStart":354.5},{"duration":185.4000005722046,"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":354.69999980926514,"connectEnd":354.69999980926514,"connectStart":354.69999980926514,"domainLookupEnd":354.69999980926514,"domainLookupStart":354.69999980926514,"fetchStart":354.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":499,"responseEnd":540.1000003814697,"responseStart":535.4000005722046,"secureConnectionStart":354.69999980926514},{"duration":185.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":354.9000005722046,"connectEnd":354.9000005722046,"connectStart":354.9000005722046,"domainLookupEnd":354.9000005722046,"domainLookupStart":354.9000005722046,"fetchStart":354.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":499.1000003814697,"responseEnd":540.4000005722046,"responseStart":537.1999998092651,"secureConnectionStart":354.9000005722046},{"duration":189.39999961853027,"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":355.1000003814697,"connectEnd":355.1000003814697,"connectStart":355.1000003814697,"domainLookupEnd":355.1000003814697,"domainLookupStart":355.1000003814697,"fetchStart":355.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":502.30000019073486,"responseEnd":544.5,"responseStart":540.8000001907349,"secureConnectionStart":355.1000003814697},{"duration":141.5999994277954,"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":355.4000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":355.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":497,"responseStart":0,"secureConnectionStart":0},{"duration":215.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":355.5,"connectEnd":355.5,"connectStart":355.5,"domainLookupEnd":355.5,"domainLookupStart":355.5,"fetchStart":355.5,"redirectEnd":0,"redirectStart":0,"requestStart":512.4000005722046,"responseEnd":571,"responseStart":566.1999998092651,"secureConnectionStart":355.5},{"duration":151.9000005722046,"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":355.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":355.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":507.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":215.79999923706055,"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":355.9000005722046,"connectEnd":355.9000005722046,"connectStart":355.9000005722046,"domainLookupEnd":355.9000005722046,"domainLookupStart":355.9000005722046,"fetchStart":355.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":512.8000001907349,"responseEnd":571.6999998092651,"responseStart":568,"secureConnectionStart":355.9000005722046},{"duration":645.8000001907349,"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":362.6000003814697,"connectEnd":362.6000003814697,"connectStart":362.6000003814697,"domainLookupEnd":362.6000003814697,"domainLookupStart":362.6000003814697,"fetchStart":362.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":580.1000003814697,"responseEnd":1008.4000005722046,"responseStart":997.1000003814697,"secureConnectionStart":362.6000003814697},{"duration":647.1000003814697,"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":362.69999980926514,"connectEnd":362.69999980926514,"connectStart":362.69999980926514,"domainLookupEnd":362.69999980926514,"domainLookupStart":362.69999980926514,"fetchStart":362.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":623.8000001907349,"responseEnd":1009.8000001907349,"responseStart":1001.1999998092651,"secureConnectionStart":362.69999980926514},{"duration":227.69999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1027.6000003814697,"connectEnd":1027.6000003814697,"connectStart":1027.6000003814697,"domainLookupEnd":1027.6000003814697,"domainLookupStart":1027.6000003814697,"fetchStart":1027.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":1224.4000005722046,"responseEnd":1255.3000001907349,"responseStart":1254,"secureConnectionStart":1027.6000003814697}],"fetchStart":0,"domainLookupStart":102,"domainLookupEnd":119,"connectStart":120,"connectEnd":139,"secureConnectionStart":128,"requestStart":139,"responseStart":347,"responseEnd":355,"domLoading":351,"domInteractive":1457,"domContentLoadedEventStart":1457,"domContentLoadedEventEnd":1515,"domComplete":1902,"loadEventStart":1902,"loadEventEnd":1902,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1428.9000005722046},{"name":"bigPipe.sidebar-id.end","time":1429.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":1429.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1432.3000001907349},{"name":"activityTabFullyLoaded","time":1533.3000001907349}],"measures":[],"correlationId":"4907100970c5a5","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":133,"dbReadsTimeInMs":23,"dbConnsTimeInMs":32,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
After I implemented MLOG_FILE_RENAME2 redo logging of all .ibd file rename operations, I ran into a different problem on ha_innobase::open():
2017-12-20 14:20:25 0x7fa6269d5700 InnoDB: Assertion failure in file /mariadb/10.2-ext/storage/innobase/dict/dict0dict.cc line 1318
InnoDB: Failing assertion: table2 == NULL
I then proceeded to revert what looks like a work-around: removing the parameters adjust_space, table_id from fil_space_for_table_exists_in_mem(). It did not make any difference.
The cause of this assertion failure is that at startup, before rolling back any transactions, the table was loaded into the data dictionary with the new name. That is, InnoDB essentially performed READ UNCOMMITTED of SYS_TABLES here:
#0 dict_table_add_to_cache (table=0x61700000a588, can_be_evicted=true,
heap=0x62c000000200)
at /mariadb/10.2-ext/storage/innobase/dict/dict0dict.cc:1285
#1 0x0000555557859b7a in dict_load_table_one (name=..., cached=true,
ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK,
fk_tables=std::deque with 0 elements)
at /mariadb/10.2-ext/storage/innobase/dict/dict0load.cc:3007
#2 0x0000555557858386 in dict_load_table (name=0x614000003728 "test/t2",
cached=true, ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK)
at /mariadb/10.2-ext/storage/innobase/dict/dict0load.cc:2805
#3 0x000055555785b29a in dict_load_table_on_id (table_id=19,
ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK)
at /mariadb/10.2-ext/storage/innobase/dict/dict0load.cc:3214
#4 0x000055555780822c in dict_table_open_on_id_low (table_id=19,
ignore_err=DICT_ERR_IGNORE_RECOVER_LOCK, open_only_if_in_cache=0)
at /mariadb/10.2-ext/storage/innobase/include/dict0priv.ic:90
#5 0x000055555780e780 in dict_table_open_on_id (table_id=19, dict_locked=0,
table_op=DICT_TABLE_OP_LOAD_TABLESPACE)
at /mariadb/10.2-ext/storage/innobase/dict/dict0dict.cc:1006
#6 0x000055555763ae19 in trx_resurrect_table_locks (trx=0x7fffec522078,
undo_ptr=0x7fffec5223a0, undo=0x612000022540)
at /mariadb/10.2-ext/storage/innobase/trx/trx0trx.cc:780
#7 0x000055555763d1eb in trx_lists_init_at_db_start ()
at /mariadb/10.2-ext/storage/innobase/trx/trx0trx.cc:1022
#8 0x000055555762e3df in trx_sys_init_at_db_start ()
at /mariadb/10.2-ext/storage/innobase/trx/trx0sys.cc:507
Later, after the incomplete data dictionary transaction was rolled back, on ha_innobase::open() for executing the SELECT, the table would be loaded with the correct name. But, a table with the same ID already existed in the cache, and the assertion fails.
It looks like we should always write an undo log record about RENAME TABLE, so that the cache can be adjusted on rollback.