Comment 1 for bug 1535312

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote : Re: Failed to prepare incremental backup if page size of general tablespace has changed between backups

The most easy way to reproduce:

mysql> create tablespace ts3 add datafile 'ts3.ibd' engine=innodb;
Query OK, 0 rows affected (0,02 sec)

Then take Full backup:

./xtrabackup --defaults-file=/etc/my.cnf --backup --datadir=/var/lib/mysql/ --target-dir=/home/backup_dir/full/ --user=root --password=Baku12345# --no-version-check

Then drop ts3 tablespace and create in remote folder:

mysql> drop tablespace ts3;
Query OK, 0 rows affected (0,00 sec)

mysql> create tablespace ts3 add datafile '/home/tablespaces/ts3.ibd' engine=innodb;
Query OK, 0 rows affected (0,01 sec)

Take incremental backup:

./xtrabackup --defaults-file=/etc/my.cnf --backup --target-dir=/home/backup_dir/inc/inc1 --incremental-basedir=/home/backup_dir/full --datadir=/var/lib/mysql/ --user=root --password=Baku12345# --no-version-check

Prepare:

./xtrabackup --defaults-file=/home/backup_dir/full/backup-my.cnf --prepare --apply-log-only --target-dir=/home/backup_dir/full

./xtrabackup --defaults-file=/home/backup_dir/full/backup-my.cnf --prepare --target-dir=/home/backup_dir/full --incremental-dir=/home/backup_dir/inc/inc1

incremental backup from 2619657407 is enabled.
xtrabackup: cd to /home/backup_dir/full
xtrabackup: This target seems to be already prepared with --apply-log-only.
InnoDB: Number of pools: 1
xtrabackup: xtrabackup_logfile detected: size=8388608, start_lsn=(2619658455)
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_data_home_dir = .
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = /home/backup_dir/inc/inc1
xtrabackup: innodb_log_files_in_group = 1
xtrabackup: innodb_log_file_size = 8388608
xtrabackup: Generating a list of tablespaces
InnoDB: Allocated tablespace ID 26 for dbtest/sbtest1, old maximum was 0
xtrabackup: page size for /home/backup_dir/inc/inc1/ibdata1.delta is 16384 bytes
Applying /home/backup_dir/inc/inc1/ibdata1.delta to ./ibdata1...
xtrabackup: page size for /home/backup_dir/inc/inc1/ts3.ibd.delta is 16384 bytes
xtrabackup: Renaming ts3 to (null)/xtrabackup_tmp_#32.ibd
InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: File ./ts3.ibd: 'rename' returned OS error 71.
xtrabackup: Cannot rename ts3 to (null)/xtrabackup_tmp_#32
xtrabackup: error: cannot open ./ts3.ibd
xtrabackup: Error: xtrabackup_apply_delta(): failed to apply /home/backup_dir/inc/inc1/ts3.ibd.delta to ./ts3.ibd.