Prepare error: Tablespace size stored in header is X pages, but the sum of data file sizes is only Y pages
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB | Status tracked in 2.4 | |||||
2.4 |
Fix Released
|
High
|
Sergei Glushchenko |
Bug Description
Here are full steps:
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
Running:
sysbench --test=
Taking backups:
xtrabackup --defaults-
xtrabackup --defaults-
xtrabackup --defaults-
xtrabackup --defaults-
Preparing backups:
xtrabackup --defaults-
xtrabackup --defaults-
xtrabackup --defaults-
[root@centos7-
xtrabackup version 2.4.1 based on MySQL server 5.7.10 Linux (x86_64) (revision id: a2dc9d4)
incremental backup from 1052459319 is enabled.
xtrabackup: cd to /home/backup_
xtrabackup: This target seems to be already prepared with --apply-log-only.
InnoDB: Number of pools: 1
xtrabackup: xtrabackup_logfile detected: size=11272192, start_lsn=
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: Generating a list of tablespaces
xtrabackup: page size for /home/backup_
Applying /home/backup_
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: PUNCH HOLE support available
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Uses event mutexes
InnoDB: GCC builtin __atomic_
InnoDB: Compressed tables use zlib 1.2.7
InnoDB: Number of pools: 1
InnoDB: Using CPU crc32 instructions
InnoDB: Initializing buffer pool, total size = 100M, instances = 1, chunk size = 100M
InnoDB: Completed initialization of buffer pool
InnoDB: page_cleaner coordinator priority: -20
InnoDB: Highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 1156966840
InnoDB: Doing recovery: scanned up to log sequence number 1162209280 (52%)
InnoDB: Doing recovery: scanned up to log sequence number 1166956838 (99%)
InnoDB: Doing recovery: scanned up to log sequence number 1157425152 (4%)
InnoDB: Doing recovery: scanned up to log sequence number 1162668032 (56%)
InnoDB: Doing recovery: scanned up to log sequence number 1166956838 (99%)
InnoDB: Database was not shutdown normally!
InnoDB: Starting crash recovery.
InnoDB: Doing recovery: scanned up to log sequence number 1157883904 (9%)
InnoDB: Doing recovery: scanned up to log sequence number 1163126784 (61%)
InnoDB: Doing recovery: scanned up to log sequence number 1166956838 (99%)
InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
InnoDB: Creating shared tablespace for temporary tables
InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
InnoDB: File './ibtmp1' size is now 12 MB.
InnoDB: 96 redo rollback segment(s) found. 1 redo rollback segment(s) are active.
InnoDB: 32 non-redo rollback segment(s) are active.
InnoDB: Waiting for purge to start
InnoDB: Tablespace size stored in header is 64128 pages, but the sum of data file sizes is only 62656 pages
InnoDB: Cannot start InnoDB. The tail of the system tablespace is missing. Have you edited innodb_
InnoDB: Plugin initialization aborted with error Generic error
xtrabackup: innodb_init(): Error occured.
summary: |
- Failed to prepare with last incremental backup using XB 2.4 and MySQL - 5.5 + Prepare error: Tablespace size stored in header is X pages, but the sum + of data file sizes is only Y pages |
Able to consistently reproduce on my laptop using following test case.
MYSQLD_ EXTRA_MY_ CNF_OPTS= " log-file- size=60M log-files- in-group= 4 file-per- table=0 buffer- pool-size= 2G
innodb-
innodb-
innodb-
innodb-
"
start_server
$MYSQL $MYSQL_ARGS test <<EOF &
create table t (a INT) engine=InnoDB;
insert into t values (1), (2), (3), (4);
start transaction;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
commit;
start transaction;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
commit;
start transaction;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
rollback;
EOF
sleep 120
$MYSQL $MYSQL_ARGS -e 'show processlist'
xtrabackup --backup --target- dir=$topdir/ bac1 dir=$topdir/ bac1
xtrabackup --prepare --target-
wait