This mtr test demonstrates the problem:
call mtr.add_suppression("InnoDB: New log files created");
|
--let $basedir=$MYSQLTEST_VARDIR/tmp/backup
|
--let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1
|
|
CREATE DATABASE db1;
|
|
--disable_result_log
|
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir
|
--enable_result_log
|
|
CREATE TABLE db1.t1 (a INT);
|
DROP DATABASE db1;
|
|
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir
|
|
--disable_result_log
|
--echo # Prepare full backup, apply incremental one
|
--exec $XTRABACKUP --prepare --target-dir=$basedir
|
--exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir
|
--enable_result_log
|
|
--let $targetdir=$basedir
|
--source include/restart_and_restore.inc
|
--enable_result_log
|
|
SHOW DATABASES;
|
SHOW TABLES IN db1;
|
|
--rmdir $basedir
|
--rmdir $incremental_dir
|
This is the output:
CREATE DATABASE db1;
|
CREATE TABLE db1.t1 (a INT);
|
DROP DATABASE db1;
|
# Prepare full backup, apply incremental one
|
# shutdown server
|
# remove datadir
|
# xtrabackup move back
|
# restart
|
SHOW DATABASES;
|
Database
|
db1
|
information_schema
|
mtr
|
mysql
|
performance_schema
|
test
|
SHOW TABLES IN db1;
|
Tables_in_db1
|
Notice, the database db1 is still there. Note, there are no tables in the database.
This mtr test demonstrates the problem:
call mtr.add_suppression("InnoDB: New log files created");
--let $basedir=$MYSQLTEST_VARDIR/tmp/backup
--let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1
CREATE DATABASE db1;
--disable_result_log
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir
--enable_result_log
CREATE TABLE db1.t1 (a INT);
DROP DATABASE db1;
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir
--disable_result_log
--echo # Prepare full backup, apply incremental one
--exec $XTRABACKUP --prepare --target-dir=$basedir
--exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir
--enable_result_log
--let $targetdir=$basedir
--source include/restart_and_restore.inc
--enable_result_log
SHOW DATABASES;
SHOW TABLES IN db1;
--rmdir $basedir
--rmdir $incremental_dir
This is the output:
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a INT);
DROP DATABASE db1;
# Prepare full backup, apply incremental one
# shutdown server
# remove datadir
# xtrabackup move back
# restart
SHOW DATABASES;
Database
db1
information_schema
mtr
mysql
performance_schema
test
SHOW TABLES IN db1;
Tables_in_db1
Notice, the database db1 is still there. Note, there are no tables in the database.