Browse Source
MDEV-13807 mariabackup --apply-log-only does generate redo log by performing rollback and possibly other tasks
MDEV-13807 mariabackup --apply-log-only does generate redo log by performing rollback and possibly other tasks
Skip rollback and other redo-log-generating tasks if srv_apply_log_only is set. Instead of assigning the debug variable recv_no_log_write = FALSE, assign it to srv_apply_log_only, so that any unwanted writes are caught.pull/459/head
11 changed files with 145 additions and 9 deletions
-
29mysql-test/suite/mariabackup/apply-log-only-incr.result
-
62mysql-test/suite/mariabackup/apply-log-only-incr.test
-
10mysql-test/suite/mariabackup/apply-log-only.result
-
25mysql-test/suite/mariabackup/apply-log-only.test
-
5storage/xtradb/log/log0recv.cc
-
2storage/xtradb/srv/srv0srv.cc
-
10storage/xtradb/srv/srv0start.cc
-
2storage/xtradb/trx/trx0rseg.cc
-
7storage/xtradb/trx/trx0sys.cc
-
1storage/xtradb/trx/trx0trx.cc
-
1storage/xtradb/trx/trx0undo.cc
@ -0,0 +1,29 @@ |
|||
call mtr.add_suppression("InnoDB: New log files created"); |
|||
CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB; |
|||
INSERT INTO t VALUES(0); |
|||
COMMIT; |
|||
start transaction; |
|||
NOT FOUND /Rollback of trx with id/ in current_test |
|||
# expect NOT FOUND |
|||
NOT FOUND /Rollback of trx with id/ in current_test |
|||
# expect NOT FOUND |
|||
commit; |
|||
SELECT count(*) FROM t; |
|||
count(*) |
|||
201 |
|||
# Restore and check results |
|||
# shutdown server |
|||
# remove datadir |
|||
# xtrabackup move back |
|||
# restart server |
|||
SELECT COUNT(*) FROM t; |
|||
COUNT(*) |
|||
1 |
|||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; |
|||
SELECT COUNT(*) FROM t; |
|||
COUNT(*) |
|||
201 |
|||
SELECT * FROM t; |
|||
a |
|||
0 |
|||
DROP TABLE t; |
|||
@ -0,0 +1,62 @@ |
|||
--source include/have_innodb.inc |
|||
|
|||
call mtr.add_suppression("InnoDB: New log files created"); |
|||
|
|||
let $basedir=$MYSQLTEST_VARDIR/tmp/backup; |
|||
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1; |
|||
|
|||
CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB; |
|||
INSERT INTO t VALUES(0); |
|||
COMMIT; |
|||
|
|||
start transaction; |
|||
--disable_query_log |
|||
let $n=100; |
|||
while ($n) { |
|||
eval INSERT t VALUES(101-$n); |
|||
dec $n; |
|||
} |
|||
|
|||
--disable_result_log |
|||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir; |
|||
--enable_result_log |
|||
let $n=100; |
|||
while ($n) { |
|||
eval INSERT t VALUES(201-$n); |
|||
dec $n; |
|||
} |
|||
--enable_query_log |
|||
|
|||
--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 ; |
|||
exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir ; |
|||
--enable_result_log |
|||
|
|||
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test; |
|||
--let SEARCH_PATTERN= Rollback of trx with id |
|||
--source include/search_pattern_in_file.inc |
|||
--echo # expect NOT FOUND |
|||
|
|||
exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ; |
|||
|
|||
--source include/search_pattern_in_file.inc |
|||
--echo # expect NOT FOUND |
|||
|
|||
commit; |
|||
SELECT count(*) FROM t; |
|||
echo # Restore and check results; |
|||
--let $targetdir=$basedir |
|||
--let $restart_parameters= --innodb-force-recovery=3 |
|||
--source include/restart_and_restore.inc |
|||
|
|||
rmdir $basedir; |
|||
|
|||
SELECT COUNT(*) FROM t; |
|||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; |
|||
SELECT COUNT(*) FROM t; |
|||
|
|||
--let $restart_parameters= |
|||
--source include/restart_mysqld.inc |
|||
|
|||
SELECT * FROM t; |
|||
DROP TABLE t; |
|||
@ -0,0 +1,10 @@ |
|||
call mtr.add_suppression("InnoDB: New log files created"); |
|||
CREATE TABLE t(a varchar(60)) ENGINE INNODB; |
|||
start transaction; |
|||
INSERT INTO t VALUES(1); |
|||
NOT FOUND /Rollback of trx with id/ in current_test |
|||
# expect NOT FOUND |
|||
SELECT count(*) FROM t; |
|||
count(*) |
|||
1 |
|||
DROP TABLE t; |
|||
@ -0,0 +1,25 @@ |
|||
--source include/have_innodb.inc |
|||
call mtr.add_suppression("InnoDB: New log files created"); |
|||
|
|||
let $basedir=$MYSQLTEST_VARDIR/tmp/backup; |
|||
|
|||
CREATE TABLE t(a varchar(60)) ENGINE INNODB; |
|||
start transaction; |
|||
INSERT INTO t VALUES(1); |
|||
|
|||
--disable_result_log |
|||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir; |
|||
--enable_result_log |
|||
|
|||
exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir ; |
|||
|
|||
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/current_test; |
|||
--let SEARCH_PATTERN= Rollback of trx with id |
|||
--source include/search_pattern_in_file.inc |
|||
--echo # expect NOT FOUND |
|||
|
|||
SELECT count(*) FROM t; |
|||
DROP TABLE t; |
|||
|
|||
# Cleanup |
|||
rmdir $basedir; |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue