Skip to content

Commit 461cf3e

Browse files
committed
Make a test more robust
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.
1 parent 9d7c088 commit 461cf3e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

mysql-test/suite/mariabackup/apply-log-only-incr.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB;
33
INSERT INTO t VALUES(0);
44
COMMIT;
55
start transaction;
6+
BEGIN;
7+
DELETE FROM t LIMIT 1;
8+
SET GLOBAL innodb_flush_log_at_trx_commit = 1;
9+
ROLLBACK;
610
NOT FOUND /Rollback of trx with id/ in current_test
711
# expect NOT FOUND
812
NOT FOUND /Rollback of trx with id/ in current_test

mysql-test/suite/mariabackup/apply-log-only-incr.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ eval INSERT t VALUES(201-$n);
2626
dec $n;
2727
}
2828
--enable_query_log
29+
connect (flush_log,localhost,root,,);
30+
BEGIN;
31+
DELETE FROM t LIMIT 1;
32+
SET GLOBAL innodb_flush_log_at_trx_commit = 1;
33+
ROLLBACK;
34+
disconnect flush_log;
35+
connection default;
2936

3037
--disable_result_log
3138
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 ;

0 commit comments

Comments
 (0)