diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-03-29 13:22:59 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-03-29 13:22:59 +0300 |
commit | adaee46a908cc2ca39ea5add85942dad714a2f0b (patch) | |
tree | 213971b61528f1dfd6e028f79627584dcf4ca5b6 | |
parent | 6cccef21a6b41b91d1d25de93d5301c16848def7 (diff) | |
download | mariadb-git-adaee46a908cc2ca39ea5add85942dad714a2f0b.tar.gz |
MDEV-15682 mariabackup.unsupported_redo fails in buildbot with wrong result code
Skip the test mariabackup.unsupported_redo if a checkpoint occurred
before mariabackup --backup completed. Remove the slow shutdowns
and restarts which were attempting to prevent the checkpoints from
occurring.
-rw-r--r-- | mysql-test/suite/innodb/include/no_checkpoint_end.inc | 5 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/unsupported_redo.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/unsupported_redo.test | 46 |
3 files changed, 41 insertions, 16 deletions
diff --git a/mysql-test/suite/innodb/include/no_checkpoint_end.inc b/mysql-test/suite/innodb/include/no_checkpoint_end.inc index 7ca81f8ade0..4a00dadfd6e 100644 --- a/mysql-test/suite/innodb/include/no_checkpoint_end.inc +++ b/mysql-test/suite/innodb/include/no_checkpoint_end.inc @@ -1,7 +1,9 @@ # Check that the latest checkpoint in the redo log files # is not newer than the checkpoint sampled by no_checkpoint_start.inc +if (!$no_checkpoint_kill) { --source include/kill_mysqld.inc +} perl; my $cp = $ENV{CHECKPOINT_LSN}; @@ -22,7 +24,8 @@ my $cp2 = $cp2hi << 32 | $cp2lo; open(OUT, ">$ENV{MYSQLTEST_VARDIR}/log/check.txt") || die; if ($cp1 > $cp || $cp2 > $cp) { - print OUT "--source include/start_mysqld.inc\n"; + print OUT "--source include/start_mysqld.inc\n" + unless $ENV{no_checkpoint_kill}; print OUT "$ENV{CLEANUP_IF_CHECKPOINT}\n"; print OUT "--skip Extra checkpoint 1 after $cp"; print OUT " ($no1hi:$no1lo=$cp1,$no2hi:$no2lo=$cp2)\n"; diff --git a/mysql-test/suite/mariabackup/unsupported_redo.result b/mysql-test/suite/mariabackup/unsupported_redo.result index 29f043fc643..543e564d8a8 100644 --- a/mysql-test/suite/mariabackup/unsupported_redo.result +++ b/mysql-test/suite/mariabackup/unsupported_redo.result @@ -5,8 +5,10 @@ call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that yo call mtr.add_suppression("InnoDB: Ignoring tablespace for `test`\\.`t21` because it could not be opened"); call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: "); call mtr.add_suppression("Table .* in the InnoDB data dictionary has tablespace id .*, but tablespace with that id or name does not exist"); +SELECT @@GLOBAL.innodb_flush_log_at_trx_commit; +@@GLOBAL.innodb_flush_log_at_trx_commit +1 CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB; -SET GLOBAL INNODB_FAST_SHUTDOWN = 0; ALTER TABLE t1 FORCE, ALGORITHM=INPLACE; # Fails during full backup DROP TABLE t1; @@ -14,7 +16,6 @@ CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB; INSERT INTO t1(a) select 1 union select 2 union select 3; # Create full backup , modify table, then fails during creation of # incremental/differential backup -SET GLOBAL INNODB_FAST_SHUTDOWN = 0; ALTER TABLE t1 FORCE, ALGORITHM=INPLACE; DROP TABLE t1; CREATE TABLE t1(i INT) ENGINE INNODB; @@ -22,7 +23,6 @@ INSERT INTO t1 VALUES(1); CREATE TABLE t21(i INT) ENGINE INNODB; INSERT INTO t21 VALUES(1); CREATE TABLE t2(i int) ENGINE INNODB; -SET GLOBAL INNODB_FAST_SHUTDOWN = 0; ALTER TABLE t21 FORCE, ALGORITHM=INPLACE; # Create partial backup (excluding table t21), Ignore the # unsupported redo log for the table t21. diff --git a/mysql-test/suite/mariabackup/unsupported_redo.test b/mysql-test/suite/mariabackup/unsupported_redo.test index f54f97b6c8b..9d54c5bbe87 100644 --- a/mysql-test/suite/mariabackup/unsupported_redo.test +++ b/mysql-test/suite/mariabackup/unsupported_redo.test @@ -10,11 +10,9 @@ call mtr.add_suppression("Table .* in the InnoDB data dictionary has tablespace let $basedir=$MYSQLTEST_VARDIR/tmp/backup; let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1; +SELECT @@GLOBAL.innodb_flush_log_at_trx_commit; CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB; - -SET GLOBAL INNODB_FAST_SHUTDOWN = 0; ---source include/restart_mysqld.inc - +--source ../../suite/innodb/include/no_checkpoint_start.inc ALTER TABLE t1 FORCE, ALGORITHM=INPLACE; # Below mariabackup operation may complete successfully if checkpoint happens @@ -22,11 +20,25 @@ ALTER TABLE t1 FORCE, ALGORITHM=INPLACE; echo # Fails during full backup; --disable_result_log ---error 1 +--error 0,1 exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir; --enable_result_log DROP TABLE t1; + +--let MYSQLD_DATADIR=$basedir/ +perl; +open(OUT, ">$ENV{MYSQLTEST_VARDIR}/log/check.txt") || die; +print OUT ' +--let no_checkpoint_end=1 +--let CLEANUP_IF_CHECKPOINT=rmdir $basedir; +--source ../../suite/innodb/include/no_checkpoint_end.inc +--exit Backup failed to fail despite MLOG_INDEX_LOAD record +' if (-f "$ENV{MYSQLD_DATADIR}/xtrabackup_info"); +close(OUT); +EOF +--source $MYSQLTEST_VARDIR/log/check.txt +--remove_file $MYSQLTEST_VARDIR/log/check.txt rmdir $basedir; CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB; @@ -39,18 +51,30 @@ INSERT INTO t1(a) select 1 union select 2 union select 3; exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir; --enable_result_log -SET GLOBAL INNODB_FAST_SHUTDOWN = 0; ---source include/restart_mysqld.inc +--source ../../suite/innodb/include/no_checkpoint_start.inc ALTER TABLE t1 FORCE, ALGORITHM=INPLACE; --disable_result_log ---error 1 +--error 0,1 exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir; --enable_result_log DROP TABLE t1; -rmdir $basedir; -rmdir $incremental_dir; + +--let MYSQLD_DATADIR=$incremental_dir/ +perl; +open(OUT, ">$ENV{MYSQLTEST_VARDIR}/log/check.txt") || die; +print OUT ' +--let no_checkpoint_end=1 +--let CLEANUP_IF_CHECKPOINT=rmdir $basedir;rmdir $incremental_dir; +--source ../../suite/innodb/include/no_checkpoint_end.inc +--exit Backup failed to fail despite MLOG_INDEX_LOAD record +' if (-f "$ENV{MYSQLD_DATADIR}/xtrabackup_info"); +close(OUT); +EOF +--source $MYSQLTEST_VARDIR/log/check.txt +--remove_file $MYSQLTEST_VARDIR/log/check.txt +rmdir $basedir;rmdir $incremental_dir; CREATE TABLE t1(i INT) ENGINE INNODB; INSERT INTO t1 VALUES(1); @@ -62,8 +86,6 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/bk; CREATE TABLE t2(i int) ENGINE INNODB; -SET GLOBAL INNODB_FAST_SHUTDOWN = 0; ---source include/restart_mysqld.inc ALTER TABLE t21 FORCE, ALGORITHM=INPLACE; --echo # Create partial backup (excluding table t21), Ignore the |