summaryrefslogtreecommitdiff
path: root/scripts/wsrep_sst_mariabackup.sh
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2019-08-26 13:37:09 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2019-08-26 13:41:06 +0200
commitde0f93fb0d7b03aaf293cc89b611aeff3ce3244e (patch)
tree0d1c08bcf811df94116b538fe51ea55fef918927 /scripts/wsrep_sst_mariabackup.sh
parent4a9fb9055eddfc9bd7098bdd1e490a8f61089e01 (diff)
downloadmariadb-git-de0f93fb0d7b03aaf293cc89b611aeff3ce3244e.tar.gz
MDEV-20420: SST failed after MDEV-18863 in some test configurations
After applying MDEV-18863, in some test configurations, SST may fails due to duplication of some parameters (in particular "--port") in the main part of the command line and after "--mysqld-args", as well as due to incorrect interpretation of the parameter "--port" passed after "--mysqld-args" when the SST script is invoked without explicitly specifying a port for SST. In addition, it is necessary to correctly handle spaces, quotation marks and special characters when copying original arguments from the argv[] array to a new command line (after "--mysqld-args"). This patch resolves these shortcomings.
Diffstat (limited to 'scripts/wsrep_sst_mariabackup.sh')
-rw-r--r--scripts/wsrep_sst_mariabackup.sh22
1 files changed, 10 insertions, 12 deletions
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index ba04c358faa..0aedb723072 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -60,7 +60,7 @@ rebuild=0
rebuildcmd=""
payload=0
pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' "
-pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE "
+pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE "
STATDIR=""
uextra=0
disver=""
@@ -130,7 +130,7 @@ get_keys()
if [[ $encrypt -eq 0 ]];then
if $MY_PRINT_DEFAULTS xtrabackup | grep -q encrypt;then
- wsrep_log_error "Unexpected option combination. SST may fail. Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html "
+ wsrep_log_error "Unexpected option combination. SST may fail. Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html"
fi
return
fi
@@ -465,7 +465,7 @@ cleanup_donor()
if [[ -n ${XTRABACKUP_PID:-} ]];then
if check_pid $XTRABACKUP_PID
then
- wsrep_log_error "xtrabackup process is still running. Killing... "
+ wsrep_log_error "xtrabackup process is still running. Killing..."
kill_xtrabackup
fi
@@ -567,7 +567,7 @@ check_extra()
# Xtrabackup works only locally.
# Hence, setting host to 127.0.0.1 unconditionally.
wsrep_log_info "SST through extra_port $eport"
- INNOEXTRA+=" --host=127.0.0.1 --port=$eport "
+ INNOEXTRA+=" --host=127.0.0.1 --port=$eport"
use_socket=0
else
wsrep_log_error "Extra port $eport null, failing"
@@ -577,8 +577,8 @@ check_extra()
wsrep_log_info "Thread pool not set, ignore the option use_extra"
fi
fi
- if [[ $use_socket -eq 1 ]] && [[ -n "${WSREP_SST_OPT_SOCKET}" ]];then
- INNOEXTRA+=" --socket=${WSREP_SST_OPT_SOCKET}"
+ if [[ $use_socket -eq 1 ]] && [[ -n "$WSREP_SST_OPT_SOCKET" ]];then
+ INNOEXTRA+=" --socket=$WSREP_SST_OPT_SOCKET"
fi
}
@@ -745,8 +745,8 @@ if [[ $ssyslog -eq 1 ]];then
logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
}
- INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply "
- INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move "
+ INNOAPPLY="${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$INNOEXTRA --apply-log \$rebuildcmd \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-apply"
+ INNOMOVE="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \${DATA} 2>&1 | logger -p daemon.err -t ${ssystag}innobackupex-move"
INNOBACKUP="${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2> >(logger -p daemon.err -t ${ssystag}innobackupex-backup)"
fi
@@ -856,13 +856,12 @@ then
get_keys
if [[ $encrypt -eq 1 ]];then
if [[ -n $ekey ]];then
- INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey "
+ INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey"
else
- INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile "
+ INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile"
fi
fi
-
check_extra
wsrep_log_info "Streaming GTID file before SST"
@@ -883,7 +882,6 @@ then
tcmd=" $scomp | $tcmd "
fi
-
send_donor $DATA "${stagemsg}-gtid"
tcmd="$ttcmd"