[MDEV-25265] ALTER TABLE…IMPORT TABLESPACE fails after DROP INDEX Created: 2021-03-26 Updated: 2021-03-29 Resolved: 2021-03-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.5.10 |
| Fix Version/s: | 10.5.10, 10.6.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
A side effect of the
A later ALTER TABLE t1 IMPORT TABLESPACE could fail with:
The reason for this would be that if purge had not been completed for the DROP INDEX operation, the data file would still contain index pages that are marked as allocated and belonging to the indexes that were dropped. This would trip a check in PageConverter::update_index_page(). We can tolerate this error and ignore the extraneous pages on import. The space that is allocated by them would never be freed. To work around this error and ensure that all index pages will really be marked as free in the data file, one should wait for purge to complete between DROP INDEX and FLUSH TABLES…FOR EXPORT, for example by executing something like this (
Sorry, exporting and importing tablespaces is somewhat of a mess until MDEV-11658 is implemented. That task would require file format changes (storing the secondary index root page numbers inside the .ibd file) as well as make the export wait for the purge of history to complete. We will work around this error by making IMPORT TABLESPACE tolerate such garbage pages. Warnings will be issued for each orphaned page:
|
| Comments |
| Comment by Marko Mäkelä [ 2021-03-29 ] |
|
The "fix" is only relaxing the check in ALTER TABLE…IMPORT TABLESPACE. |