Cannot repeatedly export tables from prepared backup
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB | Status tracked in 2.4 | |||||
2.3 |
Expired
|
Undecided
|
Unassigned | |||
2.4 |
Expired
|
Undecided
|
Unassigned |
Bug Description
1. Take a backup of a MySQL with several tables (AT, BT, CT)
2. Attempt to export out just BT (according to the manual:)
xtrabackup --prepare --export --tables mydb.BT --target-dir ./
There's a problem right here. mydb.BT will match several tables for some reason. This could be a separate bug. Even mydb\.BT matches several tables.
3. Now that BT has been exported. Attempt to export CT using the same command as above. This will fail.
There is no documentation on how to repeatedly export multiple tables from the same prepared backup.
Use Case: Full backups each morning at 2AM. At 9AM, I made a mistake and need to restore BT via export. Good. After lunch, 12:30PM, someone else makes mistake (or I need a fresh copy of BT for testing). It is no longer possible to export from this backup as it has been prepared.
Suggested Fix: Make '--export' a first-class command. If the backup needs to be prepared, do so as part of '--export' (maybe warn the user Y/N to proceed?)
Repeated executions of --export should not result in failure.
--tables clause has no effect on prepare and export, all the tables should have been exported as a result of step 2.
Basically --export instruct xtrabackup to merge the change buffer and create metadata files (*.cfg ones). There is no way to merge change buffer only for specific tables (and this is much more expensive operation than creating .cfg files), so I see no point in supporting --tables.
What kind of failure do you see when you are trying to export twice?