Skip to content

Commit

Permalink
Make a test more robust
Browse files Browse the repository at this point in the history
Sometimes, the test would fail with a result difference for
the READ UNCOMMITTED read, because the incremental backup
would finish before redo log was written for all the rows
that were inserted in the second batch.

To fix that, cause a redo log write by creating another
transaction. The transaction rollback (which internally does commit)
will be flushed to the redo log, and before that, all the preceding
changes will be flushed to the redo log as well.
  • Loading branch information
dr-m committed Dec 21, 2017
1 parent 9d7c088 commit 461cf3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mysql-test/suite/mariabackup/apply-log-only-incr.result
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB;
INSERT INTO t VALUES(0);
COMMIT;
start transaction;
BEGIN;
DELETE FROM t LIMIT 1;
SET GLOBAL innodb_flush_log_at_trx_commit = 1;
ROLLBACK;
NOT FOUND /Rollback of trx with id/ in current_test
# expect NOT FOUND
NOT FOUND /Rollback of trx with id/ in current_test
Expand Down
7 changes: 7 additions & 0 deletions mysql-test/suite/mariabackup/apply-log-only-incr.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ eval INSERT t VALUES(201-$n);
dec $n;
}
--enable_query_log
connect (flush_log,localhost,root,,);
BEGIN;
DELETE FROM t LIMIT 1;
SET GLOBAL innodb_flush_log_at_trx_commit = 1;
ROLLBACK;
disconnect flush_log;
connection default;

--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir ;
Expand Down

0 comments on commit 461cf3e

Please sign in to comment.