xtrabackup handling of space id conflicts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB |
Fix Released
|
Medium
|
Sergei Glushchenko | ||
2.2 |
Fix Released
|
Medium
|
Sergei Glushchenko | ||
2.3 |
Fix Released
|
Medium
|
Sergei Glushchenko |
Bug Description
Description:
If by any means, a stray tablespace made it through a datadir being backed up which conflicts with an existing space id in the data dictionary the backup will succeed but during prepare can lead to losing the actual table.
How to repeat:
Using mysqlsandbox, create a table t and stow away the ibd then destroy the sandbox. Create the same sandbox version and same table, then copy the first ibd under a different name i.e. space_id. Take a backup and you will get the error below:
xtrabackup: Generating a list of tablespaces
InnoDB: Attempted to open a previously opened tablespace. Previous tablespace test/space_id uses space ID: 10 at filepath: ./test/
[01] Copying ./ibdata1 to /opt/msb/
[01] ...done
[01] Copying ./test/space_id.ibd to /opt/msb/
[01] ...done
>> log scanned up to (1601607)
xtrabackup: Creating suspend file '/opt/msb/
Notice that instead of table t, space_id.ibd was copied which means the intended table was lost in the backup.
Code review also shows that error like this: "InnoDB: Attempted to open a previously opened tablespace..." is explicitly ignored in backup mode. Check the code of fil_load_ single_ table_tablespac e().