Skip to content

Commit

Permalink
MDEV-14102 restore --remove-original options for mariabackup
Browse files Browse the repository at this point in the history
  • Loading branch information
vaintroub committed Oct 23, 2017
1 parent 2aa51f5 commit 125ce6f
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,11 @@ struct my_option xb_client_options[] =
(uchar*) &opt_incremental_history_uuid, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

{"remove-original", OPT_REMOVE_ORIGINAL, "Remove .qp files after decompression.",
(uchar *) &opt_remove_original,
(uchar *) &opt_remove_original,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},

{"ftwrl-wait-query-type", OPT_LOCK_WAIT_QUERY_TYPE,
"This option specifies which types of queries are allowed to complete "
"before innobackupex will issue the global lock. Default is all.",
Expand Down
15 changes: 15 additions & 0 deletions mysql-test/suite/mariabackup/compress_qpress.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
# xtrabackup backup
INSERT INTO t VALUES(2);
# xtrabackup prepare
t.frm.qp
t.ibd.qp
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT * FROM t;
i
1
DROP TABLE t;
24 changes: 24 additions & 0 deletions mysql-test/suite/mariabackup/compress_qpress.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
echo # xtrabackup backup;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;

--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --compress --target-dir=$targetdir;
--enable_result_log

INSERT INTO t VALUES(2);


echo # xtrabackup prepare;
--disable_result_log
list_files $targetdir/test *.qp;
exec $XTRABACKUP --decompress --remove-original --target-dir=$targetdir;
list_files $targetdir/test *.qp;
exec $XTRABACKUP --prepare --target-dir=$targetdir;
-- source include/restart_and_restore.inc
--enable_result_log

SELECT * FROM t;
DROP TABLE t;
rmdir $targetdir;
2 changes: 2 additions & 0 deletions mysql-test/suite/mariabackup/suite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package My::Suite::MariaBackup;
@ISA = qw(My::Suite);
use My::Find;
use File::Basename;
use File::Which;
use strict;

return "Not run for embedded server" if $::opt_embedded_server;
Expand All @@ -26,6 +27,7 @@ $ENV{INNOBACKUPEX}= "$mariabackup_exe --innobackupex";
sub skip_combinations {
my %skip;
$skip{'include/have_file_key_management.inc'} = 'needs file_key_management plugin' unless $ENV{FILE_KEY_MANAGEMENT_SO};
$skip{'compress_qpress.test'}= 'needs qpress executable in PATH' unless which 'qpress';
%skip;
}

Expand Down

0 comments on commit 125ce6f

Please sign in to comment.