summaryrefslogtreecommitdiff
path: root/scripts/wsrep_sst_mariabackup.sh
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2021-05-24 16:48:27 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2021-05-24 16:48:27 +0200
commit81f94c26a4fb60345e260ba25f39315f3d9a6f3b (patch)
tree1aa19647894450efdf8ffd31da0b4a49130cc8e4 /scripts/wsrep_sst_mariabackup.sh
parent5c75ba9cadc7877e91d6b712f157ff5623c09c60 (diff)
downloadmariadb-git-81f94c26a4fb60345e260ba25f39315f3d9a6f3b.tar.gz
MDEV-15730: rename --stream=xbstream to --stream=mbstream
mbstream is already supported as a format name after MDEV-24580, but additional code refactoring has been done to correctly display the format name in log files and to check if the mbstream utility is in the path. Also, for xtrabackup-v2 (only available in the 10.2) both utilities are supported - both xbstram and mbstream, since they are interchangeable in this context. In this case, the original innobackupex always receives the correct --stream=xbstream option as input, but the user can actually try to use the mbstream utility during the transfer (if the user explicitly specifies this in the configuration file).
Diffstat (limited to 'scripts/wsrep_sst_mariabackup.sh')
-rw-r--r--scripts/wsrep_sst_mariabackup.sh24
1 files changed, 14 insertions, 10 deletions
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index 5618c704dbc..530d3e49256 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -55,7 +55,7 @@ ib_home_dir=""
ib_log_dir=""
ib_undo_dir=""
-sfmt="tar"
+sfmt=""
strmcmd=""
tfmt=""
tcmd=""
@@ -97,7 +97,6 @@ if [ ! -x "$MARIABACKUP_BIN" ]; then
wsrep_log_error 'mariabackup binary not found in $PATH'
exit 42
fi
-MBSTREAM_BIN=mbstream
DATA="$WSREP_SST_OPT_DATA"
INFO_FILE="xtrabackup_galera_info"
@@ -481,21 +480,26 @@ read_cnf()
get_stream()
{
if [ "$sfmt" = 'mbstream' -o "$sfmt" = 'xbstream' ]; then
- wsrep_log_info "Streaming with ${sfmt}"
+ sfmt='mbstream'
+ MBSTREAM_BIN="$(command -v mbstream)"
+ if [ -z "$MBSTREAM_BIN" ]; then
+ wsrep_log_error "Streaming with $sfmt, but $sfmt not found in path"
+ exit 42
+ fi
if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
- strmcmd="$MBSTREAM_BIN -x"
+ strmcmd="'$MBSTREAM_BIN' -x"
else
- strmcmd="$MBSTREAM_BIN -c '$INFO_FILE'"
+ strmcmd="'$MBSTREAM_BIN' -c '$INFO_FILE'"
fi
else
- sfmt="tar"
- wsrep_log_info "Streaming with tar"
- if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]]; then
- strmcmd="tar xfi -"
+ sfmt='tar'
+ if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ strmcmd='tar xfi -'
else
strmcmd="tar cf - '$INFO_FILE'"
fi
fi
+ wsrep_log_info "Streaming with $sfmt"
}
get_proc()
@@ -930,7 +934,7 @@ setup_commands()
fi
INNOAPPLY="$MARIABACKUP_BIN --prepare $disver $iapts $INNOEXTRA --target-dir='$DATA' --datadir='$DATA' $mysqld_args $INNOAPPLY"
INNOMOVE="$MARIABACKUP_BIN $WSREP_SST_OPT_CONF --move-back $disver $impts --force-non-empty-directories --target-dir='$DATA' --datadir='${TDATA:-$DATA}' $INNOMOVE"
- INNOBACKUP="$MARIABACKUP_BIN $WSREP_SST_OPT_CONF --backup $disver $iopts $tmpopts $INNOEXTRA --galera-info --stream='$sfmt' --target-dir='$itmpdir' --datadir='$DATA' $mysqld_args $INNOBACKUP"
+ INNOBACKUP="$MARIABACKUP_BIN $WSREP_SST_OPT_CONF --backup $disver $iopts $tmpopts $INNOEXTRA --galera-info --stream=$sfmt --target-dir='$itmpdir' --datadir='$DATA' $mysqld_args $INNOBACKUP"
}
get_stream