[MDEV-13237] Renaming ISL-linked InnoDB table fails with errno 18 unless you SHOW TABLE first Created: 2017-07-03 Updated: 2017-12-16 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.1.23 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Richard Stanway | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian 8, Linux 64 bit, ZFS |
||
| Description |
|
I have a separate partition for InnoDB data files and MyISAM data files in order to take advantage of optimal ZFS record sizes. This is done in a supported way, using .ISL "symbolic link files" in the MyISAM directory pointing to the .IBD file on the other partition. There are no soft or hard links on either partition. Attempting to rename an InnoDB table will sometimes return the following:
The server logs the following:
After much head scratching and verifying permissions, ISL paths, it turns out the solution is to SHOW TABLE first (yes, really!).
I am guessing that the SHOW TABLE statement causes MySQL to "notice" the ISL file and use the correct paths. Why it was trying to create a cross-device symbolic link I have no idea though. |
| Comments |
| Comment by Elena Stepanova [ 2017-07-03 ] | ||||||||||||||||||||||||||||
|
Please provide an example of the exact structure of a table with which you experience the error (SHOW CREATE TABLE ...). Please also attach your cnf file(s). | ||||||||||||||||||||||||||||
| Comment by Richard Stanway [ 2017-07-03 ] | ||||||||||||||||||||||||||||
|
The table structures affected were several Mediawiki tables. Both of them have blob columns, but that may be coincidental.
I attempted the rename first by ALTER TABLE .. RENAME then RENAME TABLE, both with the same result. I do still have several tables on our production server that are affected, they are no longer used by our application but are still exhibiting the strange rename behavior. Neither SELECT nor DESCRIBE result in "fixing" the affected tables. SHOW CREATE TABLE does fix it. Interestingly, the table remains "stuck" again immediately after the rename operation. Here's my session output:
The server is always rather active, averaging 2.5k QPS. There is very little I/O load (our dataset fits in RAM). I'd prefer not posting the full config, however it is mostly defaults with a larger innodb_log_file_size and innodb_buffer_pool_size and skip-innodb_doublewrite, separate innodb_data_home_dir and innodb_log_group_home_dir directories (separate ZFS datasets). | ||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2017-08-07 ] | ||||||||||||||||||||||||||||
|
I can't reproduce it so far. | ||||||||||||||||||||||||||||
| Comment by Richard Stanway [ 2017-08-07 ] | ||||||||||||||||||||||||||||
|
Hello, innodb_flush_method is O_DIRECT I've double checked and there are no filesystem-level symlinks under the /var/lib/mysql directory. |