diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-29 13:38:38 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-29 13:38:38 +0200 |
commit | 7b2bb67113bdda470955e3d4d72be0f2c0b38902 (patch) | |
tree | 9f9f34da1a4e48c243c56ff161987074ef907cbb /mysql-test/suite/mariabackup | |
parent | 27b762e23d8305bbc65dc61d283fe192e2dbd00a (diff) | |
parent | 1e778a3b5624f97fdf44a15fd6cee3d615891cff (diff) | |
download | mariadb-git-7b2bb67113bdda470955e3d4d72be0f2c0b38902.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/suite/mariabackup')
5 files changed, 101 insertions, 0 deletions
diff --git a/mysql-test/suite/mariabackup/ddl_incremental_encrypted.opt b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.opt new file mode 100644 index 00000000000..1de4aa13350 --- /dev/null +++ b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.opt @@ -0,0 +1,7 @@ +--plugin-load-add=$FILE_KEY_MANAGEMENT_SO +--innodb-file-per-table +--innodb-encryption-threads=4 +--innodb-encrypt-tables +--innodb-encrypt-log +--loose-file-key-management +--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt diff --git a/mysql-test/suite/mariabackup/ddl_incremental_encrypted.result b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.result new file mode 100644 index 00000000000..f42b6469db6 --- /dev/null +++ b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.result @@ -0,0 +1,26 @@ +SET @old_innodb_log_optimize_ddl=@@global.innodb_log_optimize_ddl; +SET GLOBAL innodb_log_optimize_ddl=ON; +SET @old_debug_dbug=@@global.debug_dbug; +SET GLOBAL debug_dbug="+d,ib_log_checkpoint_avoid"; +SET @old_innodb_page_cleaner_disabled_debug=@@global.innodb_page_cleaner_disabled_debug; +SET GLOBAL innodb_page_cleaner_disabled_debug=ON; +CREATE TABLE t1 (c INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +# backup +SET GLOBAL debug_dbug="+d,ib_do_not_log_crypt_data"; +INSERT INTO t1 VALUES (2); +# incremental backup +# prepare +# incremental prepare +SET GLOBAL innodb_log_optimize_ddl=@old_innodb_log_optimize_ddl; +SET GLOBAL innodb_page_cleaner_disabled_debug=@old_innodb_page_cleaner_disabled_debug; +SET GLOBAL debug_dbug=@old_debug_dbug; +# Restore and check results +# shutdown server +# remove datadir +# xtrabackup move back +# restart +SELECT count(*) FROM t1; +count(*) +2 +DROP TABLE t1; diff --git a/mysql-test/suite/mariabackup/ddl_incremental_encrypted.test b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.test new file mode 100644 index 00000000000..196201f61c7 --- /dev/null +++ b/mysql-test/suite/mariabackup/ddl_incremental_encrypted.test @@ -0,0 +1,66 @@ +# +# If MDEV-20755 bug is no fixed, incremental prepare will fail. +# +--source include/have_debug.inc +--source include/have_file_key_management.inc + +--let $base_dir=$MYSQLTEST_VARDIR/tmp/backup +--let $inc_dir=$MYSQLTEST_VARDIR/tmp/backup_inc + +SET @old_innodb_log_optimize_ddl=@@global.innodb_log_optimize_ddl; +SET GLOBAL innodb_log_optimize_ddl=ON; + +# Disable pages flushing to allow redo log records to be executed on --prepare. +SET @old_debug_dbug=@@global.debug_dbug; +SET GLOBAL debug_dbug="+d,ib_log_checkpoint_avoid"; +SET @old_innodb_page_cleaner_disabled_debug=@@global.innodb_page_cleaner_disabled_debug; +SET GLOBAL innodb_page_cleaner_disabled_debug=ON; + +CREATE TABLE t1 (c INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); + +--echo # backup +--disable_result_log +--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$base_dir +--enable_result_log + +# Do not log crypt data to avoid it's execution on --prepare. +SET GLOBAL debug_dbug="+d,ib_do_not_log_crypt_data"; +INSERT INTO t1 VALUES (2); + +--disable_result_log + +# Execute OPTIMIZE TABLE after the table is copied to execute optimized ddl +# callback during backup, which, in turns, will create t1.new file in backup +# directory. +--let after_copy_test_t1=OPTIMIZE TABLE test.t1; + +--echo # incremental backup +--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$inc_dir --incremental-basedir=$base_dir --dbug=+d,mariabackup_events + +--echo # prepare +--exec $XTRABACKUP --prepare --target-dir=$base_dir + +# If the tablespace is created during delta tablespace open procedure, then +# crypt data will be not written, and page corruption test will not pass +# when some redo log event is executed, and --prepare will fail. +--echo # incremental prepare +--exec $XTRABACKUP --prepare --target-dir=$base_dir --incremental-dir=$inc_dir + +--enable_result_log + +SET GLOBAL innodb_log_optimize_ddl=@old_innodb_log_optimize_ddl; +SET GLOBAL innodb_page_cleaner_disabled_debug=@old_innodb_page_cleaner_disabled_debug; +SET GLOBAL debug_dbug=@old_debug_dbug; + +--echo # Restore and check results +--let $targetdir=$base_dir +--source include/restart_and_restore.inc +--enable_result_log + +SELECT count(*) FROM t1; + +# Cleanup +DROP TABLE t1; +--rmdir $base_dir +--rmdir $inc_dir diff --git a/mysql-test/suite/mariabackup/mlog_index_load.result b/mysql-test/suite/mariabackup/mlog_index_load.result index 1748bc920e8..b2367d52dce 100644 --- a/mysql-test/suite/mariabackup/mlog_index_load.result +++ b/mysql-test/suite/mariabackup/mlog_index_load.result @@ -1,5 +1,6 @@ CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB; INSERT INTO t1(a) SELECT * from seq_1_to_10000; +SET GLOBAL innodb_log_optimize_ddl=ON; # xtrabackup backup t1.frm t1.ibd diff --git a/mysql-test/suite/mariabackup/mlog_index_load.test b/mysql-test/suite/mariabackup/mlog_index_load.test index fb29041fd3c..b9fd6f8ca32 100644 --- a/mysql-test/suite/mariabackup/mlog_index_load.test +++ b/mysql-test/suite/mariabackup/mlog_index_load.test @@ -2,6 +2,7 @@ CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB; INSERT INTO t1(a) SELECT * from seq_1_to_10000; +SET GLOBAL innodb_log_optimize_ddl=ON; let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; |