Skip to content

Commit

Permalink
Merge pull request #1501 from altmannmarcelo/PXB-3170-8.0
Browse files Browse the repository at this point in the history
Fix PXB-3170 - Test failure in keyring_pxb_2275.sh
  • Loading branch information
altmannmarcelo authored Oct 24, 2023
2 parents feaacd0 + ce9cbce commit 5172703
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ then
skip_test "Requires server version 5.7"
fi

start_server --innodb-log-file-size=8M
start_server --innodb-log-file-size=80M
load_dbase_schema sakila
load_dbase_data sakila
mkdir $topdir/backup

# Test 1 - should fail since we don't have any entry on keyring file yet
run_cmd_expect_failure $XB_BIN $XB_ARGS --innodb-log-file-size=8M --xtrabackup-plugin-dir=${plugin_dir} --lock-ddl=false --backup \
--target-dir=$topdir/backup --debug-sync="xtrabackup_pause_after_redo_catchup" &
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 \
--target-dir=$topdir/backup --debug-sync="xtrabackup_pause_after_redo_catchup" 2> >(tee $topdir/backup.log)&

job_pid=$!

Expand All @@ -43,12 +44,20 @@ kill -SIGCONT $xb_pid

# wait's return code will be the code returned by the background process
run_cmd wait $job_pid
if ! grep -q "is missing encryption information" $topdir/backup.log ; then
die "Backup did not fail as expected"
fi

rm -rf $topdir/backup
mkdir $topdir/backup

# Clean-up
$MYSQL $MYSQL_ARGS -Ns -e "DROP TABLE tmp1, tmp2" sakila


# Test 2 - Should pass as keyring file already have encryption information
vlog "Test 2 - Should pass as keyring file already have encryption information"

# Write data on Redo log so advance checkpoint to after creation of 1st encryption table
$MYSQL $MYSQL_ARGS -Ns -e "CREATE TABLE tmp1 ENGINE=InnoDB SELECT * FROM payment" sakila
$MYSQL $MYSQL_ARGS -Ns -e "DELETE FROM tmp1" sakila
Expand All @@ -70,8 +79,7 @@ $MYSQL $MYSQL_ARGS -Ns -e "DROP TABLE tmp1" sakila
innodb_wait_for_flush_all


# Test 2 - Should pass as keyring file alwady have encryption information
run_cmd $XB_BIN $XB_ARGS --innodb-log-file-size=8M --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=false --backup \
--target-dir=$topdir/backup --debug-sync="xtrabackup_pause_after_redo_catchup" &

job_pid=$!
Expand Down Expand Up @@ -110,5 +118,5 @@ rm -rf $mysql_datadir

xtrabackup --copy-back --target-dir=$topdir/backup

start_server --innodb-log-file-size=8M
start_server --innodb-log-file-size=80M
run_cmd $MYSQL $MYSQL_ARGS -Ns -e "SELECT * FROM tmp2;" sakila

0 comments on commit 5172703

Please sign in to comment.