Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.11.19, 11.4.13, 11.8.9, 12.3.3, 13.0.2, 13.1.1
-
None
-
None
Description
Reproduction scenario:
On source system:
CREATE TABLE t (i INT PRIMARY KEY) DATA DIRECTORY='<external directory>';
FLUSH TABLES t FOR EXPORT;
on target system:
CREATE TABLE t (i INT PRIMARY KEY) DATA DIRECTORY='<external directory>'; |
ALTER TABLE t DISCARD TABLESPACE; |
# copy over t.ibd and t.cfg from <external directory>/<dbname> in source system to same directory in target system |
ALTER TABLE t IMPORT TABLESPACE; |
|
Last statement results in this error message:
ERROR 1296 (HY000): Got error 37 'Data structure corruption' from <external directory>/<dbname>/t.ibd
The cause of the error is that DISCARD TABLESPACE deletes the .isl file in the data directory, which causes an inconsistent state. The additional problem from deleting the file is that it's the only persistent location of the DATA DIRECTORY path. In this case, as can be seen from the error message, the server knows the intended location of the import file, but that's only because the path is stored in memory (in the dict_table_t struct). Causing the table to be evicted from the cache or restarting the server after DISCARD DATABASE will leave the server in a state where it knows from metadata that the table should look for its files in a custom location, but doesn't know where that location is.
The workaround is to manually restore the .isl file after running DISCARD TABLESPACE
Attachments
Issue Links
- is blocked by
-
MDEV-41744 Stop creating .isl files for DATA DIRECTORY
-
- Open
-
- relates to
-
MDEV-41389 InnoDB: DATA DIRECTORY state in dict_table_t data race and inconsistency
-
- Stalled
-