Failed recover table data if backup was taken while 'optimize table'
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB | Status tracked in 2.4 | |||||
2.4 |
In Progress
|
High
|
Vasily Nemkov |
Bug Description
Tested with Percona Server 5.7.10-rc1
CREATE TABLE `sbtest1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`k` int(10) unsigned NOT NULL DEFAULT '0',
`c` char(120) NOT NULL DEFAULT '',
`pad` char(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `k_1` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=
While running optimize table run the full backup:
optimize table sbtest1
./xtrabackup --defaults-
Prepare:
./xtrabackup --defaults-
InnoDB: Log scan progressed past the checkpoint lsn 1695165482
InnoDB: Ignoring data file './dbtest/
InnoDB: Ignoring data file './dbtest/
InnoDB: Ignoring data file './dbtest/
InnoDB: Ignoring data file './dbtest/
InnoDB: Doing recovery: scanned up to log sequence number 1696707558 (20%)
InnoDB: Shutdown completed; log sequence number 1696708136
160204 04:43:33 completed OK!
Copy-back:
./xtrabackup --copy-back --target-
160204 04:45:58 completed OK!
Start Server:
CREATE TABLE `sbtest1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`k` int(10) unsigned NOT NULL DEFAULT '0',
`c` char(120) NOT NULL DEFAULT '',
`pad` char(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `k_1` (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMPRESSION='lz4'
mysql> select count(*) from sbtest1;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
All data was lost.
Also see http:// bugs.mysql. com/bug. php?id= 80263