From 3c89fe30163e4ef4f6a1eec933355bd15f7de09f Mon Sep 17 00:00:00 2001 From: Marcelo Altmann Date: Mon, 6 Nov 2023 10:39:20 -0300 Subject: [PATCH] PXB-3034 - Adding test cases https://jira.percona.com/browse/PXB-3034 Added test cases under suite/lockless Fixed test cases using --lock-ddl=false/true --- .../innobase/xtrabackup/src/backup_copy.cc | 1 + storage/innobase/xtrabackup/test/bootstrap.sh | 2 +- storage/innobase/xtrabackup/test/run.sh | 8 +- .../test/suites/binlog/ib_slave_info.sh | 14 ++- .../test/suites/keyring/keyring_pxb_2275.sh | 4 +- .../test/suites/keyring/pxb-1954.sh | 2 +- .../test/suites/keyring/rollback.sh | 4 +- .../suites/lockless/alter_table_add_column.sh | 116 ++++++++++++++++++ .../suites/lockless/alter_table_add_index.sh | 79 ++++++++++++ .../lockless/alter_table_drop_column.sh | 105 ++++++++++++++++ .../suites/lockless/alter_table_drop_index.sh | 79 ++++++++++++ .../test/suites/lockless/basic_operation.sh | 98 +++++++++++++++ .../test/suites/lockless/create_user.sh | 43 +++++++ .../suites/lockless/encryption_alter_MK.sh | 33 +++++ .../test/suites/lockless/encryption_force.sh | 39 ++++++ .../lockless/encryption_general_tablespace.sh | 65 ++++++++++ .../lockless/encryption_single_tablespace.sh | 59 +++++++++ .../test/suites/lockless/incremental.sh | 59 +++++++++ .../suites/lockless/lock_less_same_table.sh | 50 ++++++++ .../test/suites/lockless/optimize_table.sh | 33 +++++ .../test/suites/lockless/parallel_copy.sh | 43 +++++++ .../test/suites/lockless/partial_backup.sh | 55 +++++++++ .../rename_table_different_database.sh | 43 +++++++ .../lockless/rename_table_multiple_times.sh | 40 ++++++ .../rename_table_within_checkpoint_age.sh | 43 +++++++ .../test/suites/lockless/truncate.sh | 33 +++++ .../xtrabackup/test/suites/lockless/undo.sh | 80 ++++++++++++ .../test/suites/lockless/xbcloud.sh | 99 +++++++++++++++ .../xtrabackup/test/t/alter_instance_redo.sh | 4 +- .../innobase/xtrabackup/test/t/bug1277403.sh | 2 +- .../innobase/xtrabackup/test/t/bug1291299.sh | 2 +- .../innobase/xtrabackup/test/t/bug1461735.sh | 6 +- .../innobase/xtrabackup/test/t/bug1706582.sh | 2 +- .../xtrabackup/test/t/create_tablespace.sh | 2 +- storage/innobase/xtrabackup/test/t/ddl.sh | 2 +- .../innobase/xtrabackup/test/t/mdl_locks.sh | 8 +- .../innobase/xtrabackup/test/t/pxb-1679.sh | 2 +- .../innobase/xtrabackup/test/t/pxb-1824.sh | 6 +- .../innobase/xtrabackup/test/t/pxb-1914.sh | 4 +- .../innobase/xtrabackup/test/t/pxb-2357.sh | 2 +- .../xtrabackup/test/t/skip_orphan_table.sh | 4 +- .../xtrabackup/test/t/undo_truncation.sh | 2 +- .../xtrabackup/test/t/xb_log_overwrap.sh | 2 +- 43 files changed, 1340 insertions(+), 39 deletions(-) create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/alter_table_add_column.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/alter_table_add_index.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/alter_table_drop_column.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/alter_table_drop_index.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/basic_operation.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/create_user.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/encryption_alter_MK.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/encryption_force.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/encryption_general_tablespace.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/encryption_single_tablespace.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/incremental.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/lock_less_same_table.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/optimize_table.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/parallel_copy.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/partial_backup.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/rename_table_different_database.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/rename_table_multiple_times.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/rename_table_within_checkpoint_age.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/truncate.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/undo.sh create mode 100644 storage/innobase/xtrabackup/test/suites/lockless/xbcloud.sh diff --git a/storage/innobase/xtrabackup/src/backup_copy.cc b/storage/innobase/xtrabackup/src/backup_copy.cc index ff18f5503931..bd643dc6ccb2 100644 --- a/storage/innobase/xtrabackup/src/backup_copy.cc +++ b/storage/innobase/xtrabackup/src/backup_copy.cc @@ -1397,6 +1397,7 @@ bool backup_start(Backup_context &context) { } /* LTFB/LIFB has to be executed before copying MyISAM */ if (ddl_tracker != nullptr) { + debug_sync_point("ddl_tracker_before_lock_ddl"); if (!lock_tables_for_backup(mysql_connection, opt_backup_lock_timeout, opt_backup_lock_retry_count)) { return (false); diff --git a/storage/innobase/xtrabackup/test/bootstrap.sh b/storage/innobase/xtrabackup/test/bootstrap.sh index 87d062f6b3f8..40d6fa611a4f 100755 --- a/storage/innobase/xtrabackup/test/bootstrap.sh +++ b/storage/innobase/xtrabackup/test/bootstrap.sh @@ -111,7 +111,7 @@ main () { case "${TYPE}" in innodb80) - url="https://dev.mysql.com/get/Downloads/MySQL-8.1" + url="https://dev.mysql.com/get/Downloads/MySQL-8.2" fallback_url="https://downloads.mysql.com/archives/get/p/23/file" tarball="mysql-${VERSION}-linux-glibc2.17-${arch}.tar.xz" if ! check_url "${url}" "${tarball}"; then diff --git a/storage/innobase/xtrabackup/test/run.sh b/storage/innobase/xtrabackup/test/run.sh index ed65898743b8..a04d61bf0306 100755 --- a/storage/innobase/xtrabackup/test/run.sh +++ b/storage/innobase/xtrabackup/test/run.sh @@ -45,8 +45,8 @@ Usage: $0 [-f] [-g] [-h] [-s suite] [-t test_name] [-d mysql_basedir] [-c build_ -k Make a copy of failed var directory -t path Run only a single named test. This option can be passed multiple times. -h Print this help message --s suite Select a test suite to run. Possible values: binlog, experimental, gr, keyring, rocksdb, pagetracking, main, compression and xbcloud. - Default is 'binlog, main, gr, pagetracking, rocksdb, keyring, compression and xbcloud'. +-s suite Select a test suite to run. Possible values: binlog, experimental, gr, keyring, rocksdb, pagetracking, main, compression, lockless and xbcloud. + Default is 'binlog, main, gr, pagetracking, rocksdb, keyring, compression, lockless and xbcloud'. -j N Run tests in N parallel processes. -T seconds Test timeout (default is $TEST_TIMEOUT seconds). -x options Extra options to pass to xtrabackup @@ -939,8 +939,8 @@ if [ -n "$tname" ] then tests="$tname" else - tests="suites/binlog/* suites/pagetracking/* suites/gr/*.sh suites/keyring/*.sh suites/xbcloud/*.sh suites/compression/*.sh suites/rocksdb/*.sh t/*.sh" - suites=" pagetracking binlog gr keyring compression rocksdb main xbcloud" + tests="suites/binlog/* suites/pagetracking/* suites/gr/*.sh suites/keyring/*.sh suites/xbcloud/*.sh suites/compression/*.sh suites/lockless/*.sh suites/rocksdb/*.sh t/*.sh" + suites=" pagetracking binlog gr keyring compression lockless rocksdb main xbcloud" fi export OUTFILE="$PWD/results/setup" diff --git a/storage/innobase/xtrabackup/test/suites/binlog/ib_slave_info.sh b/storage/innobase/xtrabackup/test/suites/binlog/ib_slave_info.sh index 3d1a50953bb8..14f43bb2b761 100644 --- a/storage/innobase/xtrabackup/test/suites/binlog/ib_slave_info.sh +++ b/storage/innobase/xtrabackup/test/suites/binlog/ib_slave_info.sh @@ -80,7 +80,7 @@ run_cmd_expect_failure $XB_BIN $XB_ARGS --backup --slave-info --no-lock \ --target-dir=$topdir/backup vlog "Full backup of the slave server" -xtrabackup --backup --lock-ddl=false --target-dir=$topdir/backup --slave-info --safe-slave-backup 2>&1 | tee $topdir/pxb.log +xtrabackup --backup --lock-ddl=OFF --target-dir=$topdir/backup --slave-info --safe-slave-backup 2>&1 | tee $topdir/pxb.log grep_general_log > $topdir/log1 @@ -107,6 +107,12 @@ run_cmd egrep "MySQL slave binlog position: $pxb_log_slave_info_pattern" $topdir # PXB-3033 - Execute STOP SLAVE before copying non-InnoDB tables grep -A 5 'Slave is safe to backup.' $topdir/pxb.log | grep -q 'Starting to backup non-InnoDB tables and files' || die 'STOP SLAVE in wrong place' +# PXB-3034 - STOP SLAVE should be executed after copying InnoDB tables if lock-ddl=reduced +xtrabackup --backup --lock-ddl=REDUCED --target-dir=$topdir/backup_reduced --slave-info --safe-slave-backup 2>&1 | tee $topdir/pxb_reduced.log + +grep -A 10 'Slave is safe to backup.' $topdir/pxb_reduced.log | grep -q 'Starting to backup non-InnoDB tables and files' || die 'STOP SLAVE in wrong place' + + run_cmd egrep -q "$binlog_slave_info_pattern" \ $topdir/backup/xtrabackup_slave_info @@ -117,7 +123,7 @@ mysql -e "TRUNCATE TABLE mysql.general_log;" mkdir $topdir/xbstream_backup vlog "Full backup of the slave server to a xbstream stream" -xtrabackup --backup --lock-ddl=false --slave-info --safe-slave-backup \ +xtrabackup --backup --lock-ddl=OFF --slave-info --safe-slave-backup \ --stream=xbstream | xbstream -xv -C $topdir/xbstream_backup cat $topdir/xbstream_backup/xtrabackup_slave_info @@ -165,7 +171,7 @@ setup_slave GTID $slave2_id $master_id mysql -e "SET GLOBAL general_log=1; SET GLOBAL log_output='TABLE';" vlog "Full backup of the GTID with AUTO_POSITION slave server" -xtrabackup --backup --lock-ddl=false --slave-info --target-dir=$topdir/backup +xtrabackup --backup --lock-ddl=OFF --slave-info --target-dir=$topdir/backup grep_general_log > $topdir/log3 @@ -196,7 +202,7 @@ start_server_with_id $slave3_id setup_slave $slave3_id $master_id vlog "Full backup of the GTID slave server" -xtrabackup --backup --lock-ddl=false --slave-info --target-dir=$topdir/backup +xtrabackup --backup --lock-ddl=OFF --slave-info --target-dir=$topdir/backup run_cmd egrep -q "$binlog_slave_info_pattern" \ $topdir/backup/xtrabackup_slave_info diff --git a/storage/innobase/xtrabackup/test/suites/keyring/keyring_pxb_2275.sh b/storage/innobase/xtrabackup/test/suites/keyring/keyring_pxb_2275.sh index f8f1d0b9cf5d..35edf77a4f17 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/keyring_pxb_2275.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/keyring_pxb_2275.sh @@ -17,7 +17,7 @@ mkdir $topdir/backup # Test 1 - should fail since we don't have any entry on keyring file yet vlog "Test 1 - Should fail as keyring file does not have encryption information" -run_cmd_expect_failure $XB_BIN $XB_ARGS --innodb-log-file-size=80M --xtrabackup-plugin-dir=${plugin_dir} --lock-ddl=false --backup \ +run_cmd_expect_failure $XB_BIN $XB_ARGS --innodb-log-file-size=80M --xtrabackup-plugin-dir=${plugin_dir} --lock-ddl=OFF --backup \ --target-dir=$topdir/backup --debug-sync="xtrabackup_pause_after_redo_catchup" 2> >(tee $topdir/backup.log)& job_pid=$! @@ -79,7 +79,7 @@ $MYSQL $MYSQL_ARGS -Ns -e "DROP TABLE tmp1" sakila innodb_wait_for_flush_all -run_cmd $XB_BIN $XB_ARGS --innodb-log-file-size=80M --xtrabackup-plugin-dir=${plugin_dir} --lock-ddl=false --backup \ +run_cmd $XB_BIN $XB_ARGS --innodb-log-file-size=80M --xtrabackup-plugin-dir=${plugin_dir} --lock-ddl=OFF --backup \ --target-dir=$topdir/backup --debug-sync="xtrabackup_pause_after_redo_catchup" & job_pid=$! diff --git a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1954.sh b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1954.sh index 3e536b7e0984..0bd171e6999b 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/pxb-1954.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/pxb-1954.sh @@ -30,7 +30,7 @@ mysql -e "INSERT INTO t SELECT * FROM t" test mysql -e "ALTER TABLE t ROW_FORMAT=REDUNDANT;" test done ) >/dev/null 2>/dev/null & -xtrabackup --lock-ddl --backup --target-dir=$topdir/backup \ +xtrabackup --backup --target-dir=$topdir/backup \ --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} xtrabackup --prepare --target-dir=$topdir/backup \ diff --git a/storage/innobase/xtrabackup/test/suites/keyring/rollback.sh b/storage/innobase/xtrabackup/test/suites/keyring/rollback.sh index 37458430d8f0..26c9c25e822c 100644 --- a/storage/innobase/xtrabackup/test/suites/keyring/rollback.sh +++ b/storage/innobase/xtrabackup/test/suites/keyring/rollback.sh @@ -36,7 +36,7 @@ trap "kill_bg_trx $uncommitted_trx" EXIT wait_for_bg_trx vlog "Backup" -xtrabackup --lock-ddl --backup --target-dir=$topdir/backup \ +xtrabackup --backup --target-dir=$topdir/backup \ --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} kill_bg_trx $uncommitted_trx @@ -66,7 +66,7 @@ vlog "Test 2: No rollback on encrypted table. Lack of keyring shouldn't fail the vlog "Backup" rm -rf $topdir/backup -xtrabackup --lock-ddl --backup --target-dir=$topdir/backup \ +xtrabackup --backup --target-dir=$topdir/backup \ --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} vlog "Record db state" diff --git a/storage/innobase/xtrabackup/test/suites/lockless/alter_table_add_column.sh b/storage/innobase/xtrabackup/test/suites/lockless/alter_table_add_column.sh new file mode 100644 index 000000000000..34c4c6957dc7 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/alter_table_add_column.sh @@ -0,0 +1,116 @@ + +. inc/common.sh + +require_debug_pxb_version +require_debug_server + +function run_test() { + ALL_TABLES_IN_BACKUP=$1 + INSTANT=$2 + + vlog "Running test with ALL_TABLES_IN_BACKUP=$ALL_TABLES_IN_BACKUP and INSTANT=$INSTANT" + + start_server + if [ "$ALL_TABLES_IN_BACKUP" = "false" ]; then + $MYSQL $MYSQL_ARGS -Ns -e "SET GLOBAL innodb_checkpoint_disabled=true;" + fi + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.keep (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.keep VALUES(1, 'a'), (2, 'b');" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.rename (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.rename VALUES(1, 'a'), (2, 'b');" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.drop (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.drop VALUES(1, 'a'), (2, 'b');" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.default_val (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.default_val VALUES(1, 'a'), (2, 'b');" test + + + if [ "$ALL_TABLES_IN_BACKUP" = "true" ]; then + innodb_wait_for_flush_all + fi + + + xtrabackup --backup --target-dir=$topdir/backup_add_column \ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_add_column.log)& + + job_pid=$! + pid_file=$topdir/backup_add_column/xtrabackup_debug_sync + wait_for_xb_to_suspend $pid_file + xb_pid=`cat $pid_file` + echo "backup pid is $job_pid" + + # change default value and generate redo + QUERY="ALTER TABLE test.default_val ALTER COLUMN name SET DEFAULT 'no-name', ALGORITHM=" + if [ "$INSTANT" = "true" ]; then + QUERY+="INSTANT" + else + QUERY+="INPLACE" + fi + + $MYSQL $MYSQL_ARGS -Ns -e "${QUERY} ; INSERT INTO test.default_val VALUES (3, 'c'), (4, 'd');" test + + # Add new column to table and generate redo + QUERY="ALTER TABLE test.keep ADD COLUMN new_col VARCHAR(50) AFTER id, ALGORITHM=" + if [ "$INSTANT" = "true" ]; then + QUERY+="INSTANT" + else + QUERY+="INPLACE" + fi + + $MYSQL $MYSQL_ARGS -Ns -e "${QUERY} ; INSERT INTO test.keep VALUES (3, 'col', 'c'), (4, 'col', 'd');" test + + # Add new column to table, generate redo, rename the table and generate redo + QUERY="ALTER TABLE test.rename ADD COLUMN new_col VARCHAR(50) AFTER id, ALGORITHM=" + if [ "$INSTANT" = "true" ]; then + QUERY+="INSTANT" + else + QUERY+="INPLACE" + fi + + $MYSQL $MYSQL_ARGS -Ns -e "${QUERY} ; INSERT INTO test.rename VALUES (3, 'col', 'c'), (4, 'col', 'd');" test + $MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE test.rename TO test.after_rename; INSERT INTO test.after_rename VALUES (5, 'col', 'e'), (6, 'col', 'f');" test + + # Add new column to table, generate redo, drop the table + QUERY="ALTER TABLE test.drop ADD COLUMN new_col VARCHAR(50) AFTER id, ALGORITHM=" + if [ "$INSTANT" = "true" ]; then + QUERY+="INSTANT" + else + QUERY+="INPLACE" + fi + $MYSQL $MYSQL_ARGS -Ns -e "${QUERY} ; INSERT INTO test.drop VALUES (3, 'col', 'c'), (4, 'col', 'd'); DROP TABLE test.drop;" test + + # Create table, generate redo and add column + QUERY="CREATE TABLE test.new (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.new VALUES(1, 'a'), (2, 'b'); ALTER TABLE test.new ADD COLUMN new_col VARCHAR(50) AFTER id, ALGORITHM=" + if [ "$INSTANT" = "true" ]; then + QUERY+="INSTANT" + else + QUERY+="INPLACE" + fi + $MYSQL $MYSQL_ARGS -Ns -e "${QUERY} ; INSERT INTO test.new VALUES (3, 'col', 'c'), (4, 'col', 'd');" test + + # Resume the xtrabackup process + vlog "Resuming xtrabackup" + kill -SIGCONT $xb_pid + run_cmd wait $job_pid + + xtrabackup --prepare --target-dir=$topdir/backup_add_column + record_db_state test + stop_server + rm -rf $mysql_datadir/* + xtrabackup --copy-back --target-dir=$topdir/backup_add_column + start_server + verify_db_state test + + stop_server + rm -rf $mysql_datadir $topdir/backup_with_add_column.log $topdir/backup_add_column +} + + +# Run test with all tables in backup and algortihm inplace +run_test true false + +# Run test with all tables in backup and algortihm instant +run_test true true + +# Run test with all tables in redo and algortihm inplace +run_test false false + +# Run test with all tables in redo and algortihm instant +run_test false true + diff --git a/storage/innobase/xtrabackup/test/suites/lockless/alter_table_add_index.sh b/storage/innobase/xtrabackup/test/suites/lockless/alter_table_add_index.sh new file mode 100644 index 000000000000..dae5fd0b7782 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/alter_table_add_index.sh @@ -0,0 +1,79 @@ + +. inc/common.sh + +require_debug_pxb_version +require_debug_server + +function run_test() { + ALL_TABLES_IN_BACKUP=$1 + vlog "Running test with ALL_TABLES_IN_BACKUP=$ALL_TABLES_IN_BACKUP" + + start_server + if [ "$ALL_TABLES_IN_BACKUP" = "false" ]; then + $MYSQL $MYSQL_ARGS -Ns -e "SET GLOBAL innodb_checkpoint_disabled=true;" + fi + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.secondary_idx_keep (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.secondary_idx_keep VALUES(1, 'a'), (2, 'b');" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.secondary_idx_rename (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.secondary_idx_rename VALUES(1, 'a'), (2, 'b');" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.secondary_idx_drop (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.secondary_idx_drop VALUES(1, 'a'), (2, 'b');" test + + if [ "$ALL_TABLES_IN_BACKUP" = "true" ]; then + innodb_wait_for_flush_all + fi + + + xtrabackup --backup --target-dir=$topdir/backup_optimized_ddl \ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_optimized_ddl.log)& + + job_pid=$! + pid_file=$topdir/backup_optimized_ddl/xtrabackup_debug_sync + wait_for_xb_to_suspend $pid_file + xb_pid=`cat $pid_file` + echo "backup pid is $job_pid" + + # Add secondary index + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.secondary_idx_keep ADD INDEX(name);" test + + # Add secondary index and rename table + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.secondary_idx_rename ADD INDEX(name); RENAME TABLE test.secondary_idx_rename TO test.secondary_idx_after_rename" test + + # Add secondary index and drop table + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.secondary_idx_drop ADD INDEX(name); DROP TABLE test.secondary_idx_drop;" test + + # Create table and generate redo + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.secondary_idx_new (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.secondary_idx_new VALUES(1, 'a'), (2, 'b'); ALTER TABLE test.secondary_idx_new ADD INDEX(name);" test + + # Resume the xtrabackup process + vlog "Resuming xtrabackup" + kill -SIGCONT $xb_pid + run_cmd wait $job_pid + + original_keep_table_row_count=`$MYSQL $MYSQL_ARGS -Ns -e "SELECT COUNT(*) FROM test.secondary_idx_keep FORCE INDEX(name);" | awk {'print $1'}` + original_rename_table_row_count=`$MYSQL $MYSQL_ARGS -Ns -e "SELECT COUNT(*) FROM test.secondary_idx_after_rename FORCE INDEX(name);" | awk {'print $1'}` + xtrabackup --prepare --target-dir=$topdir/backup_optimized_ddl + record_db_state test + stop_server + rm -rf $mysql_datadir/* + xtrabackup --copy-back --target-dir=$topdir/backup_optimized_ddl + start_server + verify_db_state test + restored_keep_table_row_count=`$MYSQL $MYSQL_ARGS -Ns -e "SELECT COUNT(*) FROM test.secondary_idx_keep FORCE INDEX(name);" | awk {'print $1'}` + restored_rename_table_row_count=`$MYSQL $MYSQL_ARGS -Ns -e "SELECT COUNT(*) FROM test.secondary_idx_after_rename FORCE INDEX(name);" | awk {'print $1'}` + + if [ "$original_keep_table_row_count" != "$restored_keep_table_row_count" ]; then + die "rows in table secondary_idx_keep is $restored_keep_table_row_count when it should be $original_keep_table_row_count" + fi + + if [ "$original_rename_table_row_count" != "$restored_rename_table_row_count" ]; then + die "rows in table secondary_idx_after_rename is $restored_rename_table_row_count when it should be $original_rename_table_row_count" + fi + stop_server + rm -rf $mysql_datadir $topdir/backup_with_optimized_ddl.log $topdir/backup_optimized_ddl +} + + +# Run test with all tables in backup +run_test true + +# Run test ensure DDL for create tables are part of redo log entries +run_test false diff --git a/storage/innobase/xtrabackup/test/suites/lockless/alter_table_drop_column.sh b/storage/innobase/xtrabackup/test/suites/lockless/alter_table_drop_column.sh new file mode 100644 index 000000000000..8d3b2f81212d --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/alter_table_drop_column.sh @@ -0,0 +1,105 @@ + +. inc/common.sh + +require_debug_pxb_version +require_debug_server + +function run_test() { + ALL_TABLES_IN_BACKUP=$1 + INSTANT=$2 + + vlog "Running test with ALL_TABLES_IN_BACKUP=$ALL_TABLES_IN_BACKUP and INSTANT=$INSTANT" + + start_server + if [ "$ALL_TABLES_IN_BACKUP" = "false" ]; then + $MYSQL $MYSQL_ARGS -Ns -e "SET GLOBAL innodb_checkpoint_disabled=true;" + fi + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.keep (id INT PRIMARY KEY AUTO_INCREMENT, new_col VARCHAR(50), name VARCHAR(50)); INSERT INTO test.keep VALUES(1, 'a', 'a'), (2, 'b', 'b');" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.rename (id INT PRIMARY KEY AUTO_INCREMENT, new_col VARCHAR(50), name VARCHAR(50)); INSERT INTO test.rename VALUES(1, 'a', 'a'), (2, 'b', 'b');" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.drop (id INT PRIMARY KEY AUTO_INCREMENT, new_col VARCHAR(50), name VARCHAR(50)); INSERT INTO test.drop VALUES(1, 'a', 'a'), (2, 'b', 'b');" test + + + if [ "$ALL_TABLES_IN_BACKUP" = "true" ]; then + innodb_wait_for_flush_all + fi + + + xtrabackup --backup --target-dir=$topdir/backup_drop_column \ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_drop_column.log)& + + job_pid=$! + pid_file=$topdir/backup_drop_column/xtrabackup_debug_sync + wait_for_xb_to_suspend $pid_file + xb_pid=`cat $pid_file` + echo "backup pid is $job_pid" + + # Drop column from the table and generate redo + QUERY="ALTER TABLE test.keep DROP COLUMN new_col, ALGORITHM=" + if [ "$INSTANT" = "true" ]; then + QUERY+="INSTANT" + else + QUERY+="INPLACE" + fi + + $MYSQL $MYSQL_ARGS -Ns -e "${QUERY} ; INSERT INTO test.keep VALUES (3, 'c'), (4, 'd');" test + + # Drop column from the table, generate redo, rename the table and generate redo + QUERY="ALTER TABLE test.rename DROP COLUMN new_col, ALGORITHM=" + if [ "$INSTANT" = "true" ]; then + QUERY+="INSTANT" + else + QUERY+="INPLACE" + fi + + $MYSQL $MYSQL_ARGS -Ns -e "${QUERY} ; INSERT INTO test.rename VALUES (3, 'c'), (4, 'd');" test + $MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE test.rename TO test.after_rename; INSERT INTO test.after_rename VALUES (5, 'e'), (6, 'f');" test + + # Drop column from the table, generate redo and drop the table + QUERY="ALTER TABLE test.drop DROP COLUMN new_col, ALGORITHM=" + if [ "$INSTANT" = "true" ]; then + QUERY+="INSTANT" + else + QUERY+="INPLACE" + fi + $MYSQL $MYSQL_ARGS -Ns -e "${QUERY} ; INSERT INTO test.drop VALUES (3, 'c'), (4, 'd'); DROP TABLE test.drop;" test + + # Create table, generate redo and drop column + QUERY="CREATE TABLE test.new (id INT PRIMARY KEY AUTO_INCREMENT, new_col VARCHAR(50), name VARCHAR(50)); INSERT INTO test.new VALUES(1, 'a', 'a'), (2, 'b', 'b'); ALTER TABLE test.new DROP COLUMN new_col, ALGORITHM=" + if [ "$INSTANT" = "true" ]; then + QUERY+="INSTANT" + else + QUERY+="INPLACE" + fi + $MYSQL $MYSQL_ARGS -Ns -e "${QUERY} ; INSERT INTO test.new VALUES (3, 'c'), (4, 'd');" test + + # Resume the xtrabackup process + vlog "Resuming xtrabackup" + kill -SIGCONT $xb_pid + run_cmd wait $job_pid + + xtrabackup --prepare --target-dir=$topdir/backup_drop_column + record_db_state test + stop_server + rm -rf $mysql_datadir/* + xtrabackup --copy-back --target-dir=$topdir/backup_drop_column + start_server + verify_db_state test + + stop_server + rm -rf $mysql_datadir $topdir/backup_with_drop_column.log $topdir/backup_drop_column +} + + +# Run test with all tables in backup and algortihm inplace +run_test true false + +# Run test with all tables in backup and algortihm instant +run_test true true + +# Run test with all tables in redo and algortihm inplace +run_test false false + +# Run test with all tables in redo and algortihm instant +run_test false true + diff --git a/storage/innobase/xtrabackup/test/suites/lockless/alter_table_drop_index.sh b/storage/innobase/xtrabackup/test/suites/lockless/alter_table_drop_index.sh new file mode 100644 index 000000000000..1610dc3add53 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/alter_table_drop_index.sh @@ -0,0 +1,79 @@ + +. inc/common.sh + +require_debug_pxb_version +require_debug_server + +function run_test() { + ALL_TABLES_IN_BACKUP=$1 + vlog "Running test with ALL_TABLES_IN_BACKUP=$ALL_TABLES_IN_BACKUP" + + start_server + if [ "$ALL_TABLES_IN_BACKUP" = "false" ]; then + $MYSQL $MYSQL_ARGS -Ns -e "SET GLOBAL innodb_checkpoint_disabled=true;" + fi + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.secondary_idx_keep (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50), KEY(name)); INSERT INTO test.secondary_idx_keep VALUES(1, 'a'), (2, 'b');" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.secondary_idx_rename (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50), KEY(name)); INSERT INTO test.secondary_idx_rename VALUES(1, 'a'), (2, 'b');" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.secondary_idx_drop (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50), KEY(name)); INSERT INTO test.secondary_idx_drop VALUES(1, 'a'), (2, 'b');" test + + if [ "$ALL_TABLES_IN_BACKUP" = "true" ]; then + innodb_wait_for_flush_all + fi + + + xtrabackup --backup --target-dir=$topdir/backup_optimized_ddl \ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_optimized_ddl.log)& + + job_pid=$! + pid_file=$topdir/backup_optimized_ddl/xtrabackup_debug_sync + wait_for_xb_to_suspend $pid_file + xb_pid=`cat $pid_file` + echo "backup pid is $job_pid" + + # Add secondary index + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.secondary_idx_keep DROP INDEX name;" test + + # Add secondary index and rename table + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.secondary_idx_rename DROP INDEX name; RENAME TABLE test.secondary_idx_rename TO test.secondary_idx_after_rename" test + + # Add secondary index and drop table + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.secondary_idx_drop DROP INDEX name; DROP TABLE test.secondary_idx_drop;" test + + # Create table and generate redo + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.secondary_idx_new (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50), KEY(name)); INSERT INTO test.secondary_idx_new VALUES(1, 'a'), (2, 'b'); ALTER TABLE test.secondary_idx_new DROP INDEX name;" test + + # Resume the xtrabackup process + vlog "Resuming xtrabackup" + kill -SIGCONT $xb_pid + run_cmd wait $job_pid + + original_keep_table_row_count=`$MYSQL $MYSQL_ARGS -Ns -e "SELECT COUNT(*) FROM test.secondary_idx_keep FORCE INDEX(name);" | awk {'print $1'}` + original_rename_table_row_count=`$MYSQL $MYSQL_ARGS -Ns -e "SELECT COUNT(*) FROM test.secondary_idx_after_rename FORCE INDEX(name);" | awk {'print $1'}` + xtrabackup --prepare --target-dir=$topdir/backup_optimized_ddl + record_db_state test + stop_server + rm -rf $mysql_datadir/* + xtrabackup --copy-back --target-dir=$topdir/backup_optimized_ddl + start_server + verify_db_state test + restored_keep_table_row_count=`$MYSQL $MYSQL_ARGS -Ns -e "SELECT COUNT(*) FROM test.secondary_idx_keep FORCE INDEX(name);" | awk {'print $1'}` + restored_rename_table_row_count=`$MYSQL $MYSQL_ARGS -Ns -e "SELECT COUNT(*) FROM test.secondary_idx_after_rename FORCE INDEX(name);" | awk {'print $1'}` + + if [ "$original_keep_table_row_count" != "$restored_keep_table_row_count" ]; then + die "rows in table secondary_idx_keep is $restored_keep_table_row_count when it should be $original_keep_table_row_count" + fi + + if [ "$original_rename_table_row_count" != "$restored_rename_table_row_count" ]; then + die "rows in table secondary_idx_after_rename is $restored_rename_table_row_count when it should be $original_rename_table_row_count" + fi + stop_server + rm -rf $mysql_datadir $topdir/backup_with_optimized_ddl.log $topdir/backup_optimized_ddl +} + + +# Run test with all tables in backup +run_test true + +# Run test ensure DDL for create tables are part of redo log entries +run_test false diff --git a/storage/innobase/xtrabackup/test/suites/lockless/basic_operation.sh b/storage/innobase/xtrabackup/test/suites/lockless/basic_operation.sh new file mode 100644 index 000000000000..1dd7cf2f462a --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/basic_operation.sh @@ -0,0 +1,98 @@ +############################################################################### +# PXB-3034: Reduce the time the instance remain under lock +############################################################################### + +. inc/common.sh + +require_debug_pxb_version + + + +function run_test() { + local TEST_TYPE=$1 + + start_server + vlog "Running test with ${TEST_TYPE}" + if [[ $TEST_TYPE = "special_char" ]]; then + DELETE_TABLE="delete_Ѭtable" + ORIGINAL_TABLE="original_Ѭtable" + RENAMED_TABLE="renamed_Ѭtable" + OP_DDL_TABLE="op_Ѭddl" + NEW_TABLE="new_Ѭtable" + DELETE_TABLE_IN_DISK="delete_@U2table" + ORIGINAL_TABLE_IN_DISK="original_@U2table" + RENAMED_TABLE_IN_DISK="renamed_@U2table" + NEW_TABLE_IN_DISK="new_@U2table" + elif [[ $TEST_TYPE = "normal" ]]; then + DELETE_TABLE="delete_table" + ORIGINAL_TABLE="original_table" + RENAMED_TABLE="renamed_table" + OP_DDL_TABLE="op_ddl" + NEW_TABLE="new_table" + DELETE_TABLE_IN_DISK="delete_table" + ORIGINAL_TABLE_IN_DISK="original_table" + RENAMED_TABLE_IN_DISK="renamed_table" + NEW_TABLE_IN_DISK="new_table" + fi + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.${DELETE_TABLE} (id INT PRIMARY KEY AUTO_INCREMENT);" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.${ORIGINAL_TABLE} (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.${ORIGINAL_TABLE} VALUES(1)" test + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.${OP_DDL_TABLE} (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.${OP_DDL_TABLE} VALUES(1, 'test')" test + + innodb_wait_for_flush_all + + xtrabackup --backup --target-dir=$topdir/backup_new_table \ + --debug-sync="xtrabackup_load_tablespaces_pause" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_new_table.log)& + + job_pid=$! + pid_file=$topdir/backup_new_table/xtrabackup_debug_sync + wait_for_xb_to_suspend $pid_file + xb_pid=`cat $pid_file` + echo "backup pid is $job_pid" + + # Generate redo on table than delete it + $MYSQL $MYSQL_ARGS -Ns -e "INSERT INTO test.${DELETE_TABLE} VALUES (1); DROP TABLE test.${DELETE_TABLE};" test + + # Create table and generate redo + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.${NEW_TABLE} (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.${NEW_TABLE} VALUES (), ();" test + + # Rename table and generate redo + $MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE test.${ORIGINAL_TABLE} TO test.${RENAMED_TABLE}; INSERT INTO test.${RENAMED_TABLE} VALUES (2);" test + + # Bulk Index Load and generate redo + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.${OP_DDL_TABLE} ADD INDEX(name); INSERT INTO test.${OP_DDL_TABLE} VALUES (2, 'test2');" test + + # Resume the xtrabackup process + vlog "Resuming xtrabackup" + kill -SIGCONT $xb_pid + run_cmd wait $job_pid + + if ! egrep -q "DDL tracking : LSN: [0-9]* delete table ID: [0-9]* Name: test/${DELETE_TABLE_IN_DISK}.ibd" $topdir/backup_with_new_table.log ; then + die "xtrabackup did not handle delete table DDL" + fi + + if ! egrep -q "DDL tracking : LSN: [0-9]* create table ID: [0-9]* Name: test/${NEW_TABLE_IN_DISK}.ibd" $topdir/backup_with_new_table.log ; then + die "xtrabackup did not handle new table DDL" + fi + + if ! egrep -q "DDL tracking : LSN: [0-9]* rename table ID: [0-9]* From: test/${ORIGINAL_TABLE_IN_DISK}.ibd To: test/${RENAMED_TABLE_IN_DISK}.ibd" $topdir/backup_with_new_table.log ; then + die "xtrabackup did not handle rename table DDL" + fi + + if ! egrep -q "DDL tracking : LSN: [0-9]* direct write on table ID: [0-9]*" $topdir/backup_with_new_table.log ; then + die "xtrabackup did not handle Bulk Index Load DDL" + fi + + xtrabackup --prepare --target-dir=$topdir/backup_new_table + record_db_state test + stop_server + rm -rf $mysql_datadir/* + xtrabackup --copy-back --target-dir=$topdir/backup_new_table + start_server + verify_db_state test + stop_server + rm -rf $mysql_datadir $topdir/backup_new_table +} + +run_test normal +run_test special_char diff --git a/storage/innobase/xtrabackup/test/suites/lockless/create_user.sh b/storage/innobase/xtrabackup/test/suites/lockless/create_user.sh new file mode 100644 index 000000000000..e42abde02042 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/create_user.sh @@ -0,0 +1,43 @@ +require_debug_pxb_version +. inc/common.sh + +start_server + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.table VALUES (), (), (), ();" test +innodb_wait_for_flush_all + +xtrabackup --backup --target-dir=$topdir/backup_new_user \ + --debug-sync="xtrabackup_load_tablespaces_pause" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_new_table.log)& + +job_pid=$! +pid_file=$topdir/backup_new_user/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +# CREATE USER +$MYSQL $MYSQL_ARGS -Ns -e "CREATE USER u1@localhost IDENTIFIED BY 'SomeStr0ngPWD!';" + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +xtrabackup --prepare --target-dir=$topdir/backup_new_user +stop_server +rm -rf $mysql_datadir/* +xtrabackup --copy-back --target-dir=$topdir/backup_new_user +start_server + +ROWS=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT(*) FROM mysql.user WHERE User = 'u1'"` +if [ "$ROWS" != "1" ]; then + vlog "User u1 not found in mysql.user" + exit 1 +fi + +USER=`${MYSQL} ${MYSQL_ARGS} -u u1 -p'SomeStr0ngPWD!' -Ns -e "SELECT CURRENT_USER()"` +if [ "$USER" != "u1@localhost" ]; then + vlog "not able to login with new user u1" + exit 1 +fi diff --git a/storage/innobase/xtrabackup/test/suites/lockless/encryption_alter_MK.sh b/storage/innobase/xtrabackup/test/suites/lockless/encryption_alter_MK.sh new file mode 100644 index 000000000000..3048d8f12899 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/encryption_alter_MK.sh @@ -0,0 +1,33 @@ +## This test will be changed once https://jira.percona.com/browse/PXB-3197 is implemented +KEYRING_TYPE="component" +. inc/keyring_common.sh +. inc/keyring_file.sh + +require_debug_pxb_version +configure_server_with_component + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.enc_table (id INT PRIMARY KEY AUTO_INCREMENT) ENCRYPTION='Y'; INSERT INTO test.enc_table VALUES (), (), (), ();" test +innodb_wait_for_flush_all + +xtrabackup --backup --target-dir=$topdir/backup_alter_MK \ + --debug-sync="xtrabackup_load_tablespaces_pause" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_alter_MK.log)& + +job_pid=$! +pid_file=$topdir/backup_alter_MK/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + + +$MYSQL $MYSQL_ARGS -Ns -e "ALTER INSTANCE ROTATE INNODB MASTER KEY;" test +$MYSQL $MYSQL_ARGS -Ns -e "INSERT INTO test.enc_table VALUES ();" test +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd_expect_failure wait $job_pid + +if ! egrep -q 'Space ID [0-9]* is missing encryption information' $topdir/backup_alter_MK.log ; then + die "xtrabackup did not failed due to missing encryption information" +fi + diff --git a/storage/innobase/xtrabackup/test/suites/lockless/encryption_force.sh b/storage/innobase/xtrabackup/test/suites/lockless/encryption_force.sh new file mode 100644 index 000000000000..7ea02feaba3c --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/encryption_force.sh @@ -0,0 +1,39 @@ +KEYRING_TYPE="component" +. inc/keyring_common.sh +. inc/keyring_file.sh + +require_debug_pxb_version +configure_server_with_component + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.enc_table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.enc_table VALUES (), (), (), ();" test +innodb_wait_for_flush_all + +xtrabackup --backup --target-dir=$topdir/backup_new_table \ + --debug-sync="xtrabackup_load_tablespaces_pause" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_new_table.log)& + +job_pid=$! +pid_file=$topdir/backup_new_table/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +# Encrypt table +$MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.enc_table ENCRYPTION='Y';" test +$MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.enc_table ENCRYPTION='N';" test +$MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.enc_table ENCRYPTION='Y';" test + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +xtrabackup --prepare --target-dir=$topdir/backup_new_table --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} +record_db_state test +stop_server +rm -rf $mysql_datadir/* +xtrabackup --copy-back --target-dir=$topdir/backup_new_table --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} +cp ${instance_local_manifest} $mysql_datadir +cp ${keyring_component_cnf} $mysql_datadir +start_server +verify_db_state test diff --git a/storage/innobase/xtrabackup/test/suites/lockless/encryption_general_tablespace.sh b/storage/innobase/xtrabackup/test/suites/lockless/encryption_general_tablespace.sh new file mode 100644 index 000000000000..6914ab8e460b --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/encryption_general_tablespace.sh @@ -0,0 +1,65 @@ +KEYRING_TYPE="component" +. inc/keyring_common.sh +. inc/keyring_file.sh + +require_debug_pxb_version + + +function run_test() { + ALL_TABLES_IN_BACKUP=$1 + + vlog "Running test with ALL_TABLES_IN_BACKUP=$ALL_TABLES_IN_BACKUP" + + configure_server_with_component + if [ "$ALL_TABLES_IN_BACKUP" = "true" ]; then + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLESPACE ts1 Engine=InnoDB ENCRYPTION = 'Y';CREATE TABLE test.enc_table (id INT PRIMARY KEY AUTO_INCREMENT) TABLESPACE ts1 ENCRYPTION='Y'; INSERT INTO test.enc_table VALUES (), (), (), ();" test + innodb_wait_for_flush_all + fi + + xtrabackup --backup --target-dir=$topdir/backup_enc_general_tablespace \ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_enc_general_tablespace.log)& + + job_pid=$! + pid_file=$topdir/backup_enc_general_tablespace/xtrabackup_debug_sync + wait_for_xb_to_suspend $pid_file + xb_pid=`cat $pid_file` + echo "backup pid is $job_pid" + + # Encrypt table + if [ "$ALL_TABLES_IN_BACKUP" = "false" ]; then + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLESPACE ts1 Engine=InnoDB ENCRYPTION = 'Y';CREATE TABLE test.enc_table (id INT PRIMARY KEY AUTO_INCREMENT) TABLESPACE ts1 ENCRYPTION='Y'; INSERT INTO test.enc_table VALUES (), (), (), ();" test + innodb_wait_for_flush_all + fi + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLESPACE ts1 ENCRYPTION = 'N';" test + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLESPACE ts1 ENCRYPTION = 'Y';" test + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLESPACE ts1 ENCRYPTION = 'N';" test + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLESPACE ts1 ENCRYPTION = 'Y';" test + + # Insert some more data + $MYSQL $MYSQL_ARGS -Ns -e "INSERT INTO test.enc_table VALUES (), (), (), ();" test + + + + # Resume the xtrabackup process + vlog "Resuming xtrabackup" + kill -SIGCONT $xb_pid + run_cmd wait $job_pid + + xtrabackup --prepare --target-dir=$topdir/backup_enc_general_tablespace --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} + record_db_state test + stop_server + rm -rf $mysql_datadir/* + xtrabackup --copy-back --target-dir=$topdir/backup_enc_general_tablespace --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} + cp ${instance_local_manifest} $mysql_datadir + cp ${keyring_component_cnf} $mysql_datadir + start_server + verify_db_state test + + stop_server + rm -rf $mysql_datadir $topdir/backup_with_enc_general_tablespace.log $topdir/backup_enc_general_tablespace +} + +run_test true + +run_test false diff --git a/storage/innobase/xtrabackup/test/suites/lockless/encryption_single_tablespace.sh b/storage/innobase/xtrabackup/test/suites/lockless/encryption_single_tablespace.sh new file mode 100644 index 000000000000..c2d11f77b7d1 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/encryption_single_tablespace.sh @@ -0,0 +1,59 @@ +KEYRING_TYPE="component" +. inc/keyring_common.sh +. inc/keyring_file.sh + +require_debug_pxb_version + +function run_test() { + ALL_TABLES_IN_BACKUP=$1 + + vlog "Running test with ALL_TABLES_IN_BACKUP=$ALL_TABLES_IN_BACKUP" + + configure_server_with_component + + if [ "$ALL_TABLES_IN_BACKUP" = "true" ]; then + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.enc_table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.enc_table VALUES (), (), (), ();" test + innodb_wait_for_flush_all + fi + + xtrabackup --backup --target-dir=$topdir/backup_new_table \ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_new_table.log)& + + job_pid=$! + pid_file=$topdir/backup_new_table/xtrabackup_debug_sync + wait_for_xb_to_suspend $pid_file + xb_pid=`cat $pid_file` + echo "backup pid is $job_pid" + + if [ "$ALL_TABLES_IN_BACKUP" = "false" ]; then + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.enc_table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.enc_table VALUES (), (), (), ();" test + innodb_wait_for_flush_all + fi + + # Encrypt table + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.enc_table ENCRYPTION='Y';" test + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.enc_table ENCRYPTION='N';" test + $MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.enc_table ENCRYPTION='Y';" test + + # Resume the xtrabackup process + vlog "Resuming xtrabackup" + kill -SIGCONT $xb_pid + run_cmd wait $job_pid + + xtrabackup --prepare --target-dir=$topdir/backup_new_table --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} + record_db_state test + stop_server + rm -rf $mysql_datadir/* + xtrabackup --copy-back --target-dir=$topdir/backup_new_table --xtrabackup-plugin-dir=${plugin_dir} ${keyring_args} + cp ${instance_local_manifest} $mysql_datadir + cp ${keyring_component_cnf} $mysql_datadir + start_server + verify_db_state test + stop_server + rm -rf $mysql_datadir $topdir/backup_with_new_table.log $topdir/backup_new_table +} + +run_test true + +run_test false diff --git a/storage/innobase/xtrabackup/test/suites/lockless/incremental.sh b/storage/innobase/xtrabackup/test/suites/lockless/incremental.sh new file mode 100644 index 000000000000..237827e766ec --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/incremental.sh @@ -0,0 +1,59 @@ +############################################################################### +# PXB-3034: Reduce the time the instance remain under lock +############################################################################### + +. inc/common.sh + +require_debug_pxb_version +start_server + + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.delete_table (id INT PRIMARY KEY AUTO_INCREMENT);" test +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.original_table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.original_table VALUES(1)" test +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.op_ddl (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(50)); INSERT INTO test.op_ddl VALUES(1, 'test')" test + +innodb_wait_for_flush_all + +xtrabackup --backup --target-dir=$topdir/backup_base --lock-ddl=REDUCED + +$MYSQL $MYSQL_ARGS -Ns -e "INSERT INTO test.original_table VALUES (2);" test +innodb_wait_for_flush_all + +xtrabackup --backup --target-dir=$topdir/backup_inc --incremental-basedir=$topdir/backup_base \ + --debug-sync="xtrabackup_load_tablespaces_pause" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_new_table.log)& + +job_pid=$! +pid_file=$topdir/backup_inc/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + + +# Generate redo on table than delete it +$MYSQL $MYSQL_ARGS -Ns -e "INSERT INTO test.delete_table VALUES (1); DROP TABLE test.delete_table;" test + +# Create table and generate redo +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.new_table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.new_table VALUES (), ();" test + +# Rename table and generate redo +$MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE test.original_table TO test.renamed_table; INSERT INTO test.renamed_table VALUES (3);" test + +# Bulk Index Load and generate redo +$MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.op_ddl ADD INDEX(name); INSERT INTO test.op_ddl VALUES (2, 'test2');" test + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + + + +xtrabackup --prepare --apply-log-only --target-dir=$topdir/backup_base +xtrabackup --prepare --target-dir=$topdir/backup_base --incremental-dir=$topdir/backup_inc +record_db_state test +stop_server +rm -rf $mysql_datadir/* +xtrabackup --copy-back --target-dir=$topdir/backup_base +start_server +verify_db_state test diff --git a/storage/innobase/xtrabackup/test/suites/lockless/lock_less_same_table.sh b/storage/innobase/xtrabackup/test/suites/lockless/lock_less_same_table.sh new file mode 100644 index 000000000000..0879acf2ef60 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/lock_less_same_table.sh @@ -0,0 +1,50 @@ +############################################################################### +# PXB-XXXX: Reduce the time the instance remain under lock +# Test PXB-2683 +# This tests the same scenario with two variants +# 1. The table is created before the backup starts - copy thread will copy its .ibd +# 2. The table is created after the backup starts - DDL Tracker will copy its .ibd after the backup completes +############################################################################### + +. inc/common.sh + +require_debug_pxb_version +require_debug_server +start_server + + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.original_table_in_backup (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.original_table_in_backup VALUES (),(),(),(),()" test +innodb_wait_for_flush_all + +$MYSQL $MYSQL_ARGS -Ns -e "SET GLOBAL innodb_checkpoint_disabled=true;" + +xtrabackup --backup --target-dir=$topdir/backup_new_table \ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup.log)& + +job_pid=$! +pid_file=$topdir/backup_new_table/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +$MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE original_table_in_backup TO original_table_in_backup_renamed;" test +$MYSQL $MYSQL_ARGS -Ns -e "SET GLOBAL innodb_page_cleaner_disabled_debug=true;" +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.original_table_in_backup (id INT PRIMARY KEY AUTO_INCREMENT) KEY_BLOCK_SIZE=4;" test +$MYSQL $MYSQL_ARGS -Ns -e "INSERT INTO test.original_table_in_backup VALUES (),();" test +$MYSQL $MYSQL_ARGS -Ns -e "DROP TABLE original_table_in_backup_renamed;" test +$MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE original_table_in_backup TO original_table_in_backup_renamed;" test + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + + +xtrabackup --prepare --target-dir=$topdir/backup_new_table +record_db_state test +stop_server +rm -rf $mysql_datadir/* +xtrabackup --copy-back --target-dir=$topdir/backup_new_table +start_server +verify_db_state test diff --git a/storage/innobase/xtrabackup/test/suites/lockless/optimize_table.sh b/storage/innobase/xtrabackup/test/suites/lockless/optimize_table.sh new file mode 100644 index 000000000000..359cdd6941eb --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/optimize_table.sh @@ -0,0 +1,33 @@ +require_debug_pxb_version +. inc/common.sh + +start_server + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.table VALUES (), (), (), ();" test +innodb_wait_for_flush_all + +xtrabackup --backup --target-dir=$topdir/backup_new_table \ + --debug-sync="xtrabackup_load_tablespaces_pause" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_new_table.log)& + +job_pid=$! +pid_file=$topdir/backup_new_table/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +# Encrypt table +$MYSQL $MYSQL_ARGS -Ns -e "OPTIMIZE TABLE test.table ;" test + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +xtrabackup --prepare --target-dir=$topdir/backup_new_table +record_db_state test +stop_server +rm -rf $mysql_datadir/* +xtrabackup --copy-back --target-dir=$topdir/backup_new_table +start_server +verify_db_state test diff --git a/storage/innobase/xtrabackup/test/suites/lockless/parallel_copy.sh b/storage/innobase/xtrabackup/test/suites/lockless/parallel_copy.sh new file mode 100644 index 000000000000..2b26f33dbc96 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/parallel_copy.sh @@ -0,0 +1,43 @@ +############################################################################### +# PXB-3034: Reduce the time the instance remain under lock +############################################################################### + +. inc/common.sh + +require_debug_pxb_version +start_server + +innodb_wait_for_flush_all + +xtrabackup --backup --target-dir=$topdir/backup \ + --debug-sync="ddl_tracker_before_lock_ddl" --parallel=10 --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup.log)& + +job_pid=$! +pid_file=$topdir/backup/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +for i in {1..100} ; do + $MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.tb_${i} (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.tb_${i} VALUES (1)" test +done; + + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +# xtrabackup uses an ever incremental thread ID. Second phase copy will start from 20+ +if ! egrep -q '[1-3][0-9] \[Note\] \[MY-[0-9]*\] \[Xtrabackup\] Copying test/tb_[0-9]*\.ibd to .*/test/tb_[0-9]*.ibd.new' $topdir/backup.log ; then + die "xtrabackup did not copied tables in parallel" +fi + +xtrabackup --prepare --target-dir=$topdir/backup +record_db_state test +stop_server +rm -rf $mysql_datadir/* +xtrabackup --copy-back --target-dir=$topdir/backup +start_server +verify_db_state test diff --git a/storage/innobase/xtrabackup/test/suites/lockless/partial_backup.sh b/storage/innobase/xtrabackup/test/suites/lockless/partial_backup.sh new file mode 100644 index 000000000000..45f5aec2c030 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/partial_backup.sh @@ -0,0 +1,55 @@ +############################################################################### +# PXB-3034: Reduce the time the instance remain under lock +############################################################################### + +. inc/common.sh + +require_debug_pxb_version +start_server + +innodb_wait_for_flush_all + +xtrabackup --backup --target-dir=$topdir/backup \ + --debug-sync="ddl_tracker_before_lock_ddl" --tables=test.to_backup --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup.log)& + +job_pid=$! +pid_file=$topdir/backup/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.to_backup (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.to_backup VALUES (1)" test +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.to_skip (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.to_skip VALUES (1)" test + + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +if ls $topdir/backup/test/to_skip* 2>/dev/null; then + die "xtrabackup did not skip table" +fi + +if ! ls $topdir/backup/test/to_backup* 2>/dev/null; then + die "xtrabackup did not backup table" +fi + +xtrabackup --prepare --export --target-dir=$topdir/backup + +$MYSQL $MYSQL_ARGS -Ns -e "TRUNCATE TABLE test.to_backup" test + +ROWS=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT(*) FROM test.to_backup" test` +if [ "$ROWS" != "0" ]; then + die "xtrabackup did not truncate table" +fi + +$MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.to_backup DISCARD TABLESPACE" test +cp -R $topdir/backup/test/to_backup* $mysql_datadir/test/ +$MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.to_backup IMPORT TABLESPACE" test + +ROWS=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT(*) FROM test.to_backup" test` +if [ "$ROWS" != "1" ]; then + die "xtrabackup did not import tablespace" +fi diff --git a/storage/innobase/xtrabackup/test/suites/lockless/rename_table_different_database.sh b/storage/innobase/xtrabackup/test/suites/lockless/rename_table_different_database.sh new file mode 100644 index 000000000000..1b04ee68e7a8 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/rename_table_different_database.sh @@ -0,0 +1,43 @@ +############################################################################### +# PXB-3034: Reduce the time the instance remain under lock +############################################################################### + +. inc/common.sh + +require_debug_pxb_version +start_server + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.original_table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.original_table VALUES(1); CREATE DATABASE test2;" test +innodb_wait_for_flush_all + + +xtrabackup --backup --target-dir=$topdir/backup \ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup.log)& + +job_pid=$! +pid_file=$topdir/backup/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +# Rename table and generate redo +$MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE test.original_table TO test2.renamed_table; INSERT INTO test2.renamed_table VALUES (2);" test + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +# Ensure we have DDL tracking in the log renaming the table +if ! egrep -q 'DDL tracking : LSN: [0-9]* rename table ID: [0-9]* From: test/original_table.ibd To: test2/renamed_table.ibd' $topdir/backup.log ; then + die "xtrabackup did not handle rename table DDL" +fi + +xtrabackup --prepare --target-dir=$topdir/backup +record_db_state test +stop_server +rm -rf $mysql_datadir/* +xtrabackup --copy-back --target-dir=$topdir/backup +start_server +verify_db_state test diff --git a/storage/innobase/xtrabackup/test/suites/lockless/rename_table_multiple_times.sh b/storage/innobase/xtrabackup/test/suites/lockless/rename_table_multiple_times.sh new file mode 100644 index 000000000000..270fee900f4b --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/rename_table_multiple_times.sh @@ -0,0 +1,40 @@ +############################################################################### +# PXB-3034: Reduce the time the instance remain under lock +############################################################################### + +. inc/common.sh + +require_debug_pxb_version +start_server + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.original_table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.original_table VALUES(1);" test +innodb_wait_for_flush_all + + +xtrabackup --backup --target-dir=$topdir/backup \ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup.log)& + +job_pid=$! +pid_file=$topdir/backup/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +# Rename table and generate redo +$MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE test.original_table TO test.renamed_table; INSERT INTO test.renamed_table VALUES (2);" test +$MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE test.renamed_table TO test.renamed_table2; INSERT INTO test.renamed_table2 VALUES (3);" test + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + + +xtrabackup --prepare --target-dir=$topdir/backup +record_db_state test +stop_server +rm -rf $mysql_datadir/* +xtrabackup --copy-back --target-dir=$topdir/backup +start_server +verify_db_state test diff --git a/storage/innobase/xtrabackup/test/suites/lockless/rename_table_within_checkpoint_age.sh b/storage/innobase/xtrabackup/test/suites/lockless/rename_table_within_checkpoint_age.sh new file mode 100644 index 000000000000..d3492de05418 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/rename_table_within_checkpoint_age.sh @@ -0,0 +1,43 @@ +############################################################################### +# PXB-3034: Reduce the time the instance remain under lock +############################################################################### + +. inc/common.sh + +require_debug_pxb_version +require_debug_server +start_server + +$MYSQL $MYSQL_ARGS -Ns -e "SET GLOBAL innodb_checkpoint_disabled=true;" +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.original_table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.original_table VALUES(1)" test + +xtrabackup --backup --target-dir=$topdir/backup \ + --debug-sync="xtrabackup_load_tablespaces_pause" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup.log)& + +job_pid=$! +pid_file=$topdir/backup/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +# Rename table and generate redo +$MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE test.original_table TO test.renamed_table; INSERT INTO test.renamed_table VALUES (2);" test + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +# Ensure we have DDL tracking in the log renaming the table +if ! egrep -q 'DDL tracking : LSN: [0-9]* rename table ID: [0-9]* From: test/original_table.ibd To: test/renamed_table.ibd' $topdir/backup.log ; then + die "xtrabackup did not handle rename table DDL" +fi + +xtrabackup --prepare --target-dir=$topdir/backup +record_db_state test +stop_server +rm -rf $mysql_datadir/* +xtrabackup --copy-back --target-dir=$topdir/backup +start_server +verify_db_state test diff --git a/storage/innobase/xtrabackup/test/suites/lockless/truncate.sh b/storage/innobase/xtrabackup/test/suites/lockless/truncate.sh new file mode 100644 index 000000000000..8834fc0c80c4 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/truncate.sh @@ -0,0 +1,33 @@ +require_debug_pxb_version +. inc/common.sh + +start_server + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.table (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.table VALUES (), (), (), ();" test +innodb_wait_for_flush_all + +xtrabackup --backup --target-dir=$topdir/backup_new_table \ + --debug-sync="xtrabackup_load_tablespaces_pause" --lock-ddl=REDUCED \ + 2> >( tee $topdir/backup_with_new_table.log)& + +job_pid=$! +pid_file=$topdir/backup_new_table/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +# Encrypt table +$MYSQL $MYSQL_ARGS -Ns -e "TRUNCATE TABLE test.table ;" test + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +xtrabackup --prepare --target-dir=$topdir/backup_new_table +record_db_state test +stop_server +rm -rf $mysql_datadir/* +xtrabackup --copy-back --target-dir=$topdir/backup_new_table +start_server +verify_db_state test diff --git a/storage/innobase/xtrabackup/test/suites/lockless/undo.sh b/storage/innobase/xtrabackup/test/suites/lockless/undo.sh new file mode 100644 index 000000000000..7d4c3e19aeb4 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/undo.sh @@ -0,0 +1,80 @@ +######################################################################## +# Test support for separate UNDO tablespace +######################################################################## + +. inc/common.sh + +require_debug_pxb_version +################################################################################ +# Start an uncommitted transaction pause "indefinitely" to keep the connection +# open +################################################################################ +function start_uncomitted_transaction() +{ + run_cmd $MYSQL $MYSQL_ARGS test < >( tee $topdir/backup.log)& + +job_pid=$! +pid_file=$topdir/backup/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +$MYSQL $MYSQL_ARGS -e "INSERT INTO t1 VALUES (1)" test + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +if ! egrep -q 'DDL tracking : LSN: [0-9]* delete table ID: [0-9]* Name: undo_1.ibu' $topdir/backup.log ; then + die "xtrabackup did not handle delete table DDL" +fi + +if ! egrep -q 'DDL tracking : LSN: [0-9]* create table ID: [0-9]* Name: undo_1.ibu' $topdir/backup.log ; then + die "xtrabackup did not handle new table DDL" +fi + +kill -SIGKILL $job_master +kill -SIGKILL $undo_pid + +xtrabackup --prepare --target-dir=$topdir/backup +stop_server +rm -rf $MYSQLD_DATADIR/* +xtrabackup --copy-back --target-dir=$topdir/backup +start_server + +ROWS=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT(*) FROM t1" test` +if [ "$ROWS" != "2" ]; then + die "Unexpected number of rows in table t1: $ROWS" +fi diff --git a/storage/innobase/xtrabackup/test/suites/lockless/xbcloud.sh b/storage/innobase/xtrabackup/test/suites/lockless/xbcloud.sh new file mode 100644 index 000000000000..01f82f66c2c6 --- /dev/null +++ b/storage/innobase/xtrabackup/test/suites/lockless/xbcloud.sh @@ -0,0 +1,99 @@ +. inc/xbcloud_common.sh +is_xbcloud_credentials_set +require_debug_pxb_version + +start_server + +write_credentials + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.new_table1 (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.new_table1 VALUES (1)" test +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.new_table2 (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.new_table2 VALUES (1)" test +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.new_table3 (id INT PRIMARY KEY AUTO_INCREMENT, name varchar(10)); INSERT INTO test.new_table3 VALUES (1, 'a')" test +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.new_table4 (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.new_table4 VALUES (1)" test +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.new_table5 (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.new_table5 VALUES (1)" test +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.new_table6 (id INT PRIMARY KEY AUTO_INCREMENT, name varchar(10)); INSERT INTO test.new_table6 VALUES (1, 'a')" test + +innodb_wait_for_flush_all + + +vlog "take full backup" + +(xtrabackup --backup --target-dir=$topdir/full --stream --extra-lsndir=$topdir/full\ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ +| run_cmd xbcloud --defaults-file=$topdir/xbcloud.cnf put \ + --parallel=4 \ + ${full_backup_name}) & + +job_pid=$! +pid_file=$topdir/full/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.new_table7 (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.new_table7 VALUES (1)" test +$MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE test.new_table1 TO renamed_table; INSERT INTO test.renamed_table VALUES (2)" test +$MYSQL $MYSQL_ARGS -Ns -e "DROP TABLE test.new_table2" test +$MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.new_table3 ADD INDEX(name); INSERT INTO test.new_table3 VALUES (2, 'test2');" test + + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +innodb_wait_for_flush_all + +vlog "take incremental backup" + + + +(xtrabackup --backup --target-dir=$topdir/inc --incremental-basedir=$topdir/full --stream \ + --debug-sync="ddl_tracker_before_lock_ddl" --lock-ddl=REDUCED \ +| run_cmd xbcloud --defaults-file=$topdir/xbcloud.cnf put \ + --parallel=4 \ + ${inc_backup_name}) & +job_pid=$! +pid_file=$topdir/inc/xtrabackup_debug_sync +wait_for_xb_to_suspend $pid_file +xb_pid=`cat $pid_file` +echo "backup pid is $job_pid" + +$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE test.new_table8 (id INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO test.new_table8 VALUES (1)" test +$MYSQL $MYSQL_ARGS -Ns -e "RENAME TABLE test.new_table4 TO renamed_table2; INSERT INTO test.renamed_table2 VALUES (2)" test +$MYSQL $MYSQL_ARGS -Ns -e "DROP TABLE test.new_table5" test +$MYSQL $MYSQL_ARGS -Ns -e "ALTER TABLE test.new_table6 ADD INDEX(name); INSERT INTO test.new_table6 VALUES (2, 'test2');" test + +# Resume the xtrabackup process +vlog "Resuming xtrabackup" +kill -SIGCONT $xb_pid +run_cmd wait $job_pid + +innodb_wait_for_flush_all +record_db_state test + +vlog "download and prepare" +mkdir $topdir/downloaded_full +mkdir $topdir/downloaded_inc + +run_cmd xbcloud --defaults-file=$topdir/xbcloud.cnf get \ + --parallel=4 \ + ${full_backup_name} | \ + xbstream -xv -C $topdir/downloaded_full --parallel=4 + +xtrabackup --prepare --apply-log-only --target-dir=$topdir/downloaded_full + +run_cmd xbcloud --defaults-file=$topdir/xbcloud.cnf get \ + --parallel=4 \ + ${inc_backup_name} | \ + xbstream -xv -C $topdir/downloaded_inc + +xtrabackup --prepare \ + --target-dir=$topdir/downloaded_full \ + --incremental-dir=$topdir/downloaded_inc + +stop_server +rm -rf $MYSQLD_DATADIR/* + +xtrabackup --copy-back --target-dir=$topdir/downloaded_full +start_server +verify_db_state test diff --git a/storage/innobase/xtrabackup/test/t/alter_instance_redo.sh b/storage/innobase/xtrabackup/test/t/alter_instance_redo.sh index ea0c16a52678..6a32e808cd22 100644 --- a/storage/innobase/xtrabackup/test/t/alter_instance_redo.sh +++ b/storage/innobase/xtrabackup/test/t/alter_instance_redo.sh @@ -41,7 +41,7 @@ mysql -e "alter instance enable innodb redo_log" vlog "### case #3 check when redo log is disabled after backup is started ###" run_cmd_expect_failure xtrabackup --backup \ - --target-dir=$topdir/full --lock-ddl=false \ + --target-dir=$topdir/full --lock-ddl=OFF \ --debug-sync="data_copy_thread_func" 2>&1 \ | tee $topdir/full.log & job_pid=$! @@ -66,7 +66,7 @@ mysql -e "alter instance enable innodb redo_log" vlog "### case #4 check redo log is disabled during incremental backup ###" run_cmd xtrabackup --backup --target-dir=$topdir/full -run_cmd_expect_failure xtrabackup --backup --lock-ddl=false --target-dir=$topdir/inc \ +run_cmd_expect_failure xtrabackup --backup --lock-ddl=OFF --target-dir=$topdir/inc \ --incremental-basedir=$topdir/full \ --debug-sync="data_copy_thread_func" 2>&1 \ | tee $topdir/inc.log & diff --git a/storage/innobase/xtrabackup/test/t/bug1277403.sh b/storage/innobase/xtrabackup/test/t/bug1277403.sh index 47a8866d0614..bdd68d804bfc 100644 --- a/storage/innobase/xtrabackup/test/t/bug1277403.sh +++ b/storage/innobase/xtrabackup/test/t/bug1277403.sh @@ -12,7 +12,7 @@ has_backup_locks && skip_test "Requires server without backup locks support" mysql -e 'CREATE TABLE t1 (a INT) engine=MyISAM' test -xtrabackup --backup --lock-ddl=false --target-dir=$topdir/full_backup +xtrabackup --backup --lock-ddl=OFF --target-dir=$topdir/full_backup grep_general_log > $topdir/log1 diff --git a/storage/innobase/xtrabackup/test/t/bug1291299.sh b/storage/innobase/xtrabackup/test/t/bug1291299.sh index 069765fb573f..399093681b2c 100644 --- a/storage/innobase/xtrabackup/test/t/bug1291299.sh +++ b/storage/innobase/xtrabackup/test/t/bug1291299.sh @@ -10,7 +10,7 @@ remote_dir=$TEST_VAR_ROOT/var1/remote_dir mkdir -p $remote_dir start_server --innodb_directories=$remote_dir -xtrabackup --backup --lock-ddl=false --target-dir=$topdir/backup \ +xtrabackup --backup --lock-ddl=OFF --target-dir=$topdir/backup \ --debug-sync="data_copy_thread_func" & job_pid=$! diff --git a/storage/innobase/xtrabackup/test/t/bug1461735.sh b/storage/innobase/xtrabackup/test/t/bug1461735.sh index 07307c1934cd..855fa36445a9 100644 --- a/storage/innobase/xtrabackup/test/t/bug1461735.sh +++ b/storage/innobase/xtrabackup/test/t/bug1461735.sh @@ -13,7 +13,7 @@ debug-sync=xtrabackup_load_tablespaces_pause start_server function backup_local() { - xtrabackup --backup --lock-ddl=false --target-dir=$topdir/backup + xtrabackup --backup --lock-ddl=OFF --target-dir=$topdir/backup } function prepare_local() { @@ -21,7 +21,7 @@ function prepare_local() { } function backup_xbstream() { - xtrabackup --backup --lock-ddl=false --stream=xbstream --target-dir=$topdir/backup > $topdir/backup.xbs + xtrabackup --backup --lock-ddl=OFF --stream=xbstream --target-dir=$topdir/backup > $topdir/backup.xbs } function prepare_xbstream() { @@ -30,7 +30,7 @@ function prepare_xbstream() { } function backup_rsync() { - xtrabackup --backup --lock-ddl=false --rsync --target-dir=$topdir/backup + xtrabackup --backup --lock-ddl=OFF --rsync --target-dir=$topdir/backup } function prepare_rsync() { diff --git a/storage/innobase/xtrabackup/test/t/bug1706582.sh b/storage/innobase/xtrabackup/test/t/bug1706582.sh index 52003d3e7825..806513949c46 100644 --- a/storage/innobase/xtrabackup/test/t/bug1706582.sh +++ b/storage/innobase/xtrabackup/test/t/bug1706582.sh @@ -6,7 +6,7 @@ start_server vlog "Full backup" -run_cmd_expect_failure xtrabackup --backup --lock-ddl --lock-ddl-per-table \ +run_cmd_expect_failure xtrabackup --backup --lock-ddl=ON --lock-ddl-per-table \ --target-dir=$topdir/data/full 2>&1 | \ grep "\-\-lock-ddl and --lock-ddl-per-table are mutually exclusive" diff --git a/storage/innobase/xtrabackup/test/t/create_tablespace.sh b/storage/innobase/xtrabackup/test/t/create_tablespace.sh index bee8287a8ec5..6e819fb522c3 100644 --- a/storage/innobase/xtrabackup/test/t/create_tablespace.sh +++ b/storage/innobase/xtrabackup/test/t/create_tablespace.sh @@ -46,7 +46,7 @@ INSERT INTO test.t2_3 VALUES (1100), (1200), (1300); EOF xtrabackup --backup --target-dir=$topdir/inc \ - --incremental-basedir=$topdir/full --lock-ddl=false \ + --incremental-basedir=$topdir/full --lock-ddl=OFF \ --debug-sync="data_copy_thread_func" & job_pid=$! diff --git a/storage/innobase/xtrabackup/test/t/ddl.sh b/storage/innobase/xtrabackup/test/t/ddl.sh index 0076d1aebbb8..185729b91cd1 100644 --- a/storage/innobase/xtrabackup/test/t/ddl.sh +++ b/storage/innobase/xtrabackup/test/t/ddl.sh @@ -45,7 +45,7 @@ start_server mkdir -p $topdir/backup # Backup -xtrabackup --datadir=$mysql_datadir --lock-ddl=false --backup \ +xtrabackup --datadir=$mysql_datadir --lock-ddl=OFF --backup \ --target-dir=$topdir/backup \ --debug-sync="data_copy_thread_func" & diff --git a/storage/innobase/xtrabackup/test/t/mdl_locks.sh b/storage/innobase/xtrabackup/test/t/mdl_locks.sh index ac5874cec105..bbdea0378909 100644 --- a/storage/innobase/xtrabackup/test/t/mdl_locks.sh +++ b/storage/innobase/xtrabackup/test/t/mdl_locks.sh @@ -53,7 +53,7 @@ function alter_table() { -e "ALTER TABLE sakila.payment ADD COLUMN col1 INT" } -xtrabackup --backup --lock-ddl \ +xtrabackup --backup --lock-ddl=ON \ --lock-ddl-timeout=2 --target-dir=$topdir/backup1 start_transaction & @@ -72,7 +72,7 @@ done # SELECT blocks ALTER TABLE, ALTER TABLE blocks LOCK TABLES FOR BACKUP run_cmd_expect_failure \ - $XB_BIN $XB_ARGS --backup --lock-ddl --lock-ddl-timeout=2 \ + $XB_BIN $XB_ARGS --backup --lock-ddl=ON --lock-ddl-timeout=2 \ --target-dir=$topdir/backup2 mysql -Ne "SELECT CONCAT('KILL ', id, ';') FROM \ @@ -82,7 +82,7 @@ OR info LIKE 'ALTER TABLE%'" | mysql wait $tr_job_id wait $ddl_job_id -xtrabackup --backup --lock-ddl \ +xtrabackup --backup --lock-ddl=ON \ --lock-ddl-timeout=2 --target-dir=$topdir/backup3 mysql -e "CREATE TABLE rcount (val INT)" test @@ -108,7 +108,7 @@ done if has_backup_locks ; then - xtrabackup --backup --lock-ddl --target-dir=$topdir/backup6 + xtrabackup --backup --lock-ddl=ON --target-dir=$topdir/backup6 xtrabackup --prepare --target-dir=$topdir/backup6 fi diff --git a/storage/innobase/xtrabackup/test/t/pxb-1679.sh b/storage/innobase/xtrabackup/test/t/pxb-1679.sh index c7ea2b7653a2..0ba8b11891e0 100644 --- a/storage/innobase/xtrabackup/test/t/pxb-1679.sh +++ b/storage/innobase/xtrabackup/test/t/pxb-1679.sh @@ -27,7 +27,7 @@ CREATE TABLE test02 (id int auto_increment primary key, a TEXT, b TEXT); INSERT INTO test02 SELECT * FROM test01; EOF -xtrabackup --backup --lock-ddl=false --target-dir=$topdir/backup 2>&1 | tee /dev/stderr | \ +xtrabackup --backup --lock-ddl=OFF --target-dir=$topdir/backup 2>&1 | tee /dev/stderr | \ while read line ; do echo $line if [ $( echo $line | grep -i -c './test/test01#p#p3.ibd') -eq 1 ]; then diff --git a/storage/innobase/xtrabackup/test/t/pxb-1824.sh b/storage/innobase/xtrabackup/test/t/pxb-1824.sh index df992b960e29..ae493b0608c7 100644 --- a/storage/innobase/xtrabackup/test/t/pxb-1824.sh +++ b/storage/innobase/xtrabackup/test/t/pxb-1824.sh @@ -45,10 +45,10 @@ while true ; do mysql -e "TRUNCATE test.sbtest1" done >/dev/null 2>/dev/null & -xtrabackup --lock-ddl --backup --target-dir=$topdir/backup --parallel=8 -xtrabackup --lock-ddl --backup --incremental-basedir=$topdir/backup \ +xtrabackup --backup --target-dir=$topdir/backup --parallel=8 +xtrabackup --backup --incremental-basedir=$topdir/backup \ --target-dir=$topdir/inc --parallel=8 -xtrabackup --lock-ddl --backup --incremental-basedir=$topdir/inc \ +xtrabackup --backup --incremental-basedir=$topdir/inc \ --target-dir=$topdir/inc1 --parallel=8 if ! grep -q flushed_lsn $topdir/backup/xtrabackup_checkpoints ; then diff --git a/storage/innobase/xtrabackup/test/t/pxb-1914.sh b/storage/innobase/xtrabackup/test/t/pxb-1914.sh index 0b7af67ebd50..ba3f73dc094a 100644 --- a/storage/innobase/xtrabackup/test/t/pxb-1914.sh +++ b/storage/innobase/xtrabackup/test/t/pxb-1914.sh @@ -15,12 +15,12 @@ xtrabackup --backup --target-dir=$topdir/bak1 rm -rf $topdir/bak1 -xtrabackup --backup --lock-ddl=false --backup-lock-retry-count=5 --backup-lock-timeout=3 \ +xtrabackup --backup --lock-ddl=OFF --backup-lock-retry-count=5 --backup-lock-timeout=3 \ --target-dir=$topdir/bak1 rm -rf $topdir/bak1 -xtrabackup --backup --lock-ddl=false --backup-lock-timeout=2 --backup-lock-retry-count=4 \ +xtrabackup --backup --lock-ddl=OFF --backup-lock-timeout=2 --backup-lock-retry-count=4 \ --no-backup-locks --target-dir=$topdir/bak1 rm -rf $topdir/bak1 diff --git a/storage/innobase/xtrabackup/test/t/pxb-2357.sh b/storage/innobase/xtrabackup/test/t/pxb-2357.sh index 9428ad237323..926725267e91 100644 --- a/storage/innobase/xtrabackup/test/t/pxb-2357.sh +++ b/storage/innobase/xtrabackup/test/t/pxb-2357.sh @@ -12,7 +12,7 @@ start_server --innodb-redo-log-archive-dirs=":$TEST_VAR_ROOT/b" mkdir $topdir/backup -xtrabackup --backup --lock-ddl=false --target-dir=$topdir/backup \ +xtrabackup --backup --lock-ddl=OFF --target-dir=$topdir/backup \ --debug-sync="stop_before_redo_archive" \ 2> >(tee $topdir/backup.log)& diff --git a/storage/innobase/xtrabackup/test/t/skip_orphan_table.sh b/storage/innobase/xtrabackup/test/t/skip_orphan_table.sh index 929149344610..aad0aae5917d 100644 --- a/storage/innobase/xtrabackup/test/t/skip_orphan_table.sh +++ b/storage/innobase/xtrabackup/test/t/skip_orphan_table.sh @@ -65,10 +65,10 @@ if [ $(grep 'Warning.*space.*does not exist' $topdir/pxb.log | wc -l) -eq 1 ] die "not exactly 1 tablespace missing " fi -vlog "Case#2 backup should copy FTS in backup with lock-ddl=false" +vlog "Case#2 backup should copy FTS in backup with lock-ddl=OFF" rm -rf ${topdir}/backup -run_cmd xtrabackup --backup --lock-ddl=false --target-dir=${topdir}/backup +run_cmd xtrabackup --backup --lock-ddl=OFF --target-dir=${topdir}/backup vlog "Case#2 prepare should work with orphan ibd copied" diff --git a/storage/innobase/xtrabackup/test/t/undo_truncation.sh b/storage/innobase/xtrabackup/test/t/undo_truncation.sh index 431c0c65c9b9..4ffced4dc58d 100644 --- a/storage/innobase/xtrabackup/test/t/undo_truncation.sh +++ b/storage/innobase/xtrabackup/test/t/undo_truncation.sh @@ -18,5 +18,5 @@ for i in {1..100} ; do done & sleep 1s -run_cmd_expect_failure $XB_BIN $XB_ARGS --backup --lock-ddl=false --target-dir=$topdir/backup +run_cmd_expect_failure $XB_BIN $XB_ARGS --backup --lock-ddl=OFF --target-dir=$topdir/backup diff --git a/storage/innobase/xtrabackup/test/t/xb_log_overwrap.sh b/storage/innobase/xtrabackup/test/t/xb_log_overwrap.sh index 3edca204f859..564f8cbcd09d 100644 --- a/storage/innobase/xtrabackup/test/t/xb_log_overwrap.sh +++ b/storage/innobase/xtrabackup/test/t/xb_log_overwrap.sh @@ -14,7 +14,7 @@ mkdir $topdir/backup #avoid log wrap before we do the first scan innodb_wait_for_flush_all run_cmd_expect_failure $XB_BIN $XB_ARGS --datadir=$mysql_datadir --backup \ - --lock-ddl=false --innodb_log_file_size=4M --target-dir=$topdir/backup \ + --lock-ddl=OFF --innodb_log_file_size=4M --target-dir=$topdir/backup \ --debug-sync="xtrabackup_copy_logfile_pause" & job_pid=$!