Commit e0324bf3 authored by Julius Goryavsky's avatar Julius Goryavsky

wsrep sst scripts: removing extra blank lines and spaces

Removed numerous extra blank lines and spaces that interfere with
reading and understanding program code, making it more difficult to
find errors in scripts. I also removed all extra trailing spaces at
the ends of lines, which lead to marking extra lines as changes
(in subsequent changes). The amount of indentation in some parts
of the code has also been normalized.
parent 562c8825
...@@ -183,8 +183,8 @@ get_transfer() ...@@ -183,8 +183,8 @@ get_transfer()
if [[ $tfmt == 'nc' ]];then if [[ $tfmt == 'nc' ]];then
wsrep_check_programs nc wsrep_check_programs nc
wsrep_log_info "Using netcat as streamer" wsrep_log_info "Using netcat as streamer"
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
if nc -h 2>&1 | grep -q ncat;then if nc -h 2>&1 | grep -q ncat;then
# Ncat # Ncat
...@@ -217,7 +217,6 @@ get_transfer() ...@@ -217,7 +217,6 @@ get_transfer()
tcmd_extra+="-N" tcmd_extra+="-N"
wsrep_log_info "Using nc -N" wsrep_log_info "Using nc -N"
fi fi
# netcat doesn't understand [] around IPv6 address # netcat doesn't understand [] around IPv6 address
if nc -h 2>&1 | grep -q ncat;then if nc -h 2>&1 | grep -q ncat;then
# Ncat # Ncat
...@@ -281,7 +280,6 @@ get_transfer() ...@@ -281,7 +280,6 @@ get_transfer()
tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},key=${tkey},cafile=${tcert}${sockopt}" tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},key=${tkey},cafile=${tcert}${sockopt}"
fi fi
fi fi
else else
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio" tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio"
...@@ -290,7 +288,6 @@ get_transfer() ...@@ -290,7 +288,6 @@ get_transfer()
fi fi
fi fi
fi fi
} }
parse_cnf() parse_cnf()
...@@ -324,7 +321,6 @@ get_footprint() ...@@ -324,7 +321,6 @@ get_footprint()
adjust_progress() adjust_progress()
{ {
if ! command -v pv >/dev/null;then if ! command -v pv >/dev/null;then
wsrep_log_error "pv not found in path: $PATH" wsrep_log_error "pv not found in path: $PATH"
wsrep_log_error "Disabling all progress/rate-limiting" wsrep_log_error "Disabling all progress/rate-limiting"
...@@ -426,7 +422,6 @@ get_stream() ...@@ -426,7 +422,6 @@ get_stream()
else else
strmcmd="tar cf - \${INFO_FILE} " strmcmd="tar cf - \${INFO_FILE} "
fi fi
fi fi
} }
...@@ -458,6 +453,7 @@ cleanup_joiner() ...@@ -458,6 +453,7 @@ cleanup_joiner()
wsrep_log_info "Cleaning up fifo file $progress" wsrep_log_info "Cleaning up fifo file $progress"
rm $progress rm $progress
fi fi
if [[ -n ${STATDIR:-} ]];then if [[ -n ${STATDIR:-} ]];then
[[ -d $STATDIR ]] && rm -rf $STATDIR [[ -d $STATDIR ]] && rm -rf $STATDIR
fi fi
...@@ -468,13 +464,11 @@ cleanup_joiner() ...@@ -468,13 +464,11 @@ cleanup_joiner()
# This means no setsid done in mysqld. # This means no setsid done in mysqld.
# We don't want to kill mysqld here otherwise. # We don't want to kill mysqld here otherwise.
if [[ $$ -eq $pgid ]];then if [[ $$ -eq $pgid ]];then
# This means a signal was delivered to the process. # This means a signal was delivered to the process.
# So, more cleanup. # So, more cleanup.
if [[ $estatus -ge 128 ]];then if [[ $estatus -ge 128 ]];then
kill -KILL -$$ || true kill -KILL -$$ || true
fi fi
fi fi
exit $estatus exit $estatus
...@@ -500,8 +494,8 @@ cleanup_donor() ...@@ -500,8 +494,8 @@ cleanup_donor()
wsrep_log_error "xtrabackup process is still running. Killing..." wsrep_log_error "xtrabackup process is still running. Killing..."
kill_xtrabackup kill_xtrabackup
fi fi
fi fi
rm -f ${DATA}/${IST_FILE} || true rm -f ${DATA}/${IST_FILE} || true
if [[ -n $progress && -p $progress ]];then if [[ -n $progress && -p $progress ]];then
...@@ -525,17 +519,14 @@ cleanup_donor() ...@@ -525,17 +519,14 @@ cleanup_donor()
# This means no setsid done in mysqld. # This means no setsid done in mysqld.
# We don't want to kill mysqld here otherwise. # We don't want to kill mysqld here otherwise.
if [[ $$ -eq $pgid ]];then if [[ $$ -eq $pgid ]];then
# This means a signal was delivered to the process. # This means a signal was delivered to the process.
# So, more cleanup. # So, more cleanup.
if [[ $estatus -ge 128 ]];then if [[ $estatus -ge 128 ]];then
kill -KILL -$$ || true kill -KILL -$$ || true
fi fi
fi fi
exit $estatus exit $estatus
} }
kill_xtrabackup() kill_xtrabackup()
...@@ -653,7 +644,6 @@ recv_joiner() ...@@ -653,7 +644,6 @@ recv_joiner()
fi fi
} }
send_donor() send_donor()
{ {
local dir=$1 local dir=$1
...@@ -665,7 +655,6 @@ send_donor() ...@@ -665,7 +655,6 @@ send_donor()
set -e set -e
popd 1>/dev/null popd 1>/dev/null
for ecode in "${RC[@]}";do for ecode in "${RC[@]}";do
if [[ $ecode -ne 0 ]];then if [[ $ecode -ne 0 ]];then
wsrep_log_error "Error while getting data from donor node: " \ wsrep_log_error "Error while getting data from donor node: " \
...@@ -673,7 +662,6 @@ send_donor() ...@@ -673,7 +662,6 @@ send_donor()
exit 32 exit 32
fi fi
done done
} }
monitor_process() monitor_process()
...@@ -681,18 +669,14 @@ monitor_process() ...@@ -681,18 +669,14 @@ monitor_process()
local sst_stream_pid=$1 local sst_stream_pid=$1
while true ; do while true ; do
if ! ps -p "${WSREP_SST_OPT_PARENT}" &>/dev/null; then if ! ps -p "${WSREP_SST_OPT_PARENT}" &>/dev/null; then
wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly." wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
exit 32 exit 32
fi fi
if ! ps -p "${sst_stream_pid}" &>/dev/null; then if ! ps -p "${sst_stream_pid}" &>/dev/null; then
break break
fi fi
sleep 0.1 sleep 0.1
done done
} }
...@@ -751,7 +735,6 @@ if [[ $ssyslog -eq 1 ]];then ...@@ -751,7 +735,6 @@ if [[ $ssyslog -eq 1 ]];then
if ! command -v logger >/dev/null;then if ! command -v logger >/dev/null;then
wsrep_log_error "logger not in path: $PATH. Ignoring" wsrep_log_error "logger not in path: $PATH. Ignoring"
else else
wsrep_log_info "Logging all stderr of SST/Innobackupex to syslog" wsrep_log_info "Logging all stderr of SST/Innobackupex to syslog"
exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE) exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE)
...@@ -794,7 +777,6 @@ then ...@@ -794,7 +777,6 @@ then
else else
newfile=${INNOAPPLYLOG}.${ARCHIVETIMESTAMP} newfile=${INNOAPPLYLOG}.${ARCHIVETIMESTAMP}
fi fi
wsrep_log_info "Moving ${INNOAPPLYLOG} to ${newfile}" wsrep_log_info "Moving ${INNOAPPLYLOG} to ${newfile}"
mv "${INNOAPPLYLOG}" "${newfile}" mv "${INNOAPPLYLOG}" "${newfile}"
gzip "${newfile}" gzip "${newfile}"
...@@ -827,12 +809,12 @@ then ...@@ -827,12 +809,12 @@ then
mv "${INNOBACKUPLOG}" "${newfile}" mv "${INNOBACKUPLOG}" "${newfile}"
gzip "${newfile}" gzip "${newfile}"
fi fi
fi fi
INNOAPPLY="${INNOBACKUPEX_BIN} --prepare $disver $iapts \$INNOEXTRA $rebuildcmd --target-dir=\${DATA} &> ${INNOAPPLYLOG}" INNOAPPLY="${INNOBACKUPEX_BIN} --prepare $disver $iapts \$INNOEXTRA $rebuildcmd --target-dir=\${DATA} &> ${INNOAPPLYLOG}"
INNOMOVE="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} --move-back $disver $impts --force-non-empty-directories --target-dir=\${DATA} &> ${INNOMOVELOG}" INNOMOVE="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} --move-back $disver $impts --force-non-empty-directories --target-dir=\${DATA} &> ${INNOMOVELOG}"
INNOBACKUP="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} --backup $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt --target-dir=\$itmpdir 2> ${INNOBACKUPLOG}" INNOBACKUP="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} --backup $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt --target-dir=\$itmpdir 2> ${INNOBACKUPLOG}"
fi fi
get_stream get_stream
...@@ -939,7 +921,6 @@ then ...@@ -939,7 +921,6 @@ then
# innobackupex implicitly writes PID to fixed location in $xtmpdir # innobackupex implicitly writes PID to fixed location in $xtmpdir
XTRABACKUP_PID="$xtmpdir/xtrabackup_pid" XTRABACKUP_PID="$xtmpdir/xtrabackup_pid"
else # BYPASS FOR IST else # BYPASS FOR IST
wsrep_log_info "Bypassing the SST for IST" wsrep_log_info "Bypassing the SST for IST"
...@@ -1003,7 +984,6 @@ then ...@@ -1003,7 +984,6 @@ then
stagemsg="Joiner-Recv" stagemsg="Joiner-Recv"
sencrypted=1 sencrypted=1
nthreads=1 nthreads=1
...@@ -1050,7 +1030,6 @@ then ...@@ -1050,7 +1030,6 @@ then
MAGIC_FILE="${STATDIR}/${INFO_FILE}" MAGIC_FILE="${STATDIR}/${INFO_FILE}"
recv_joiner $STATDIR "${stagemsg}-gtid" $stimeout 1 recv_joiner $STATDIR "${stagemsg}-gtid" $stimeout 1
if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null
then then
wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly." wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
...@@ -1094,12 +1073,9 @@ then ...@@ -1094,12 +1073,9 @@ then
fi fi
fi fi
TDATA=${DATA} TDATA=${DATA}
DATA="${DATA}/.sst" DATA="${DATA}/.sst"
MAGIC_FILE="${DATA}/${INFO_FILE}" MAGIC_FILE="${DATA}/${INFO_FILE}"
wsrep_log_info "Waiting for SST streaming to complete!" wsrep_log_info "Waiting for SST streaming to complete!"
monitor_process $jpid monitor_process $jpid
...@@ -1147,7 +1123,6 @@ then ...@@ -1147,7 +1123,6 @@ then
dcmd="xargs -n 2 qpress -T${nproc}d" dcmd="xargs -n 2 qpress -T${nproc}d"
fi fi
# Decompress the qpress files # Decompress the qpress files
wsrep_log_info "Decompression with $nproc threads" wsrep_log_info "Decompression with $nproc threads"
timeit "Joiner-Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd" timeit "Joiner-Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd"
...@@ -1165,7 +1140,6 @@ then ...@@ -1165,7 +1140,6 @@ then
fi fi
fi fi
if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then
BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG) BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG)
...@@ -1206,9 +1180,10 @@ then ...@@ -1206,9 +1180,10 @@ then
exit 22 exit 22
fi fi
else else
wsrep_log_info "${IST_FILE} received from donor: Running IST" wsrep_log_info "${IST_FILE} received from donor: Running IST"
fi fi
if [[ ! -r ${MAGIC_FILE} ]];then if [[ ! -r ${MAGIC_FILE} ]];then
...@@ -1217,6 +1192,7 @@ then ...@@ -1217,6 +1192,7 @@ then
fi fi
wsrep_log_info "Galera co-ords from recovery: $(cat ${MAGIC_FILE})" wsrep_log_info "Galera co-ords from recovery: $(cat ${MAGIC_FILE})"
cat "${MAGIC_FILE}" # Output : UUID:seqno wsrep_gtid_domain_id cat "${MAGIC_FILE}" # Output : UUID:seqno wsrep_gtid_domain_id
wsrep_log_info "Total time on joiner: $totime seconds" wsrep_log_info "Total time on joiner: $totime seconds"
fi fi
......
...@@ -373,11 +373,13 @@ EOF ...@@ -373,11 +373,13 @@ EOF
fi fi
else # BYPASS else # BYPASS
wsrep_log_info "Bypassing state dump." wsrep_log_info "Bypassing state dump."
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id # Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
# (separated by a space). # (separated by a space).
STATE="$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID" STATE="$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID"
fi fi
echo "continue" # now server can resume updating data echo "continue" # now server can resume updating data
...@@ -518,7 +520,6 @@ EOF ...@@ -518,7 +520,6 @@ EOF
if ! [ -z $WSREP_SST_OPT_BINLOG ] if ! [ -z $WSREP_SST_OPT_BINLOG ]
then then
OLD_PWD="$(pwd)" OLD_PWD="$(pwd)"
cd $BINLOG_DIRNAME cd $BINLOG_DIRNAME
...@@ -537,9 +538,10 @@ EOF ...@@ -537,9 +538,10 @@ EOF
fi fi
done done
fi fi
cd "$OLD_PWD"
cd "$OLD_PWD"
fi fi
if [ -r "$MAGIC_FILE" ] if [ -r "$MAGIC_FILE" ]
then then
# UUID:seqno & wsrep_gtid_domain_id is received here. # UUID:seqno & wsrep_gtid_domain_id is received here.
...@@ -548,6 +550,7 @@ EOF ...@@ -548,6 +550,7 @@ EOF
# this message should cause joiner to abort # this message should cause joiner to abort
echo "rsync process ended without creating '$MAGIC_FILE'" echo "rsync process ended without creating '$MAGIC_FILE'"
fi fi
wsrep_cleanup_progress_file wsrep_cleanup_progress_file
# cleanup_joiner # cleanup_joiner
else else
......
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
# Documentation: http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html # Documentation: http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
# Make sure to read that before proceeding! # Make sure to read that before proceeding!
. $(dirname $0)/wsrep_sst_common . $(dirname $0)/wsrep_sst_common
ealgo="" ealgo=""
...@@ -389,7 +386,6 @@ get_transfer() ...@@ -389,7 +386,6 @@ get_transfer()
wsrep_log_info "Encrypting with CERT: $ssl_cert, KEY: $ssl_key, CA: $ssl_ca" wsrep_log_info "Encrypting with CERT: $ssl_cert, KEY: $ssl_key, CA: $ssl_ca"
tcmd="socat -u stdio openssl-connect:${WSREP_SST_OPT_HOST}:${TSST_PORT},cert=${ssl_cert},key=${ssl_key},cafile=${ssl_ca},verify=1${donor_extra}${sockopt}" tcmd="socat -u stdio openssl-connect:${WSREP_SST_OPT_HOST}:${TSST_PORT},cert=${ssl_cert},key=${ssl_key},cafile=${ssl_ca},verify=1${donor_extra}${sockopt}"
fi fi
else else
if [[ $encrypt -eq 1 ]]; then if [[ $encrypt -eq 1 ]]; then
wsrep_log_warning "**** WARNING **** encrypt=1 is deprecated and will be removed in a future release" wsrep_log_warning "**** WARNING **** encrypt=1 is deprecated and will be removed in a future release"
...@@ -420,7 +416,6 @@ get_footprint() ...@@ -420,7 +416,6 @@ get_footprint()
adjust_progress() adjust_progress()
{ {
if [[ ! -x `which pv` ]];then if [[ ! -x `which pv` ]];then
wsrep_log_error "pv not found in path: $PATH" wsrep_log_error "pv not found in path: $PATH"
wsrep_log_error "Disabling all progress/rate-limiting" wsrep_log_error "Disabling all progress/rate-limiting"
...@@ -470,7 +465,6 @@ read_cnf() ...@@ -470,7 +465,6 @@ read_cnf()
scomp=$(parse_cnf sst compressor "") scomp=$(parse_cnf sst compressor "")
sdecomp=$(parse_cnf sst decompressor "") sdecomp=$(parse_cnf sst decompressor "")
# Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html # Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
if [[ -z $ealgo ]];then if [[ -z $ealgo ]];then
ealgo=$(parse_cnf sst encrypt-algo "") ealgo=$(parse_cnf sst encrypt-algo "")
...@@ -526,7 +520,6 @@ get_stream() ...@@ -526,7 +520,6 @@ get_stream()
else else
strmcmd="tar cf - \${INFO_FILE} " strmcmd="tar cf - \${INFO_FILE} "
fi fi
fi fi
} }
...@@ -558,6 +551,7 @@ cleanup_joiner() ...@@ -558,6 +551,7 @@ cleanup_joiner()
wsrep_log_info "Cleaning up fifo file $progress" wsrep_log_info "Cleaning up fifo file $progress"
rm $progress rm $progress
fi fi
if [[ -n ${STATDIR:-} ]];then if [[ -n ${STATDIR:-} ]];then
[[ -d $STATDIR ]] && rm -rf $STATDIR [[ -d $STATDIR ]] && rm -rf $STATDIR
fi fi
...@@ -568,13 +562,11 @@ cleanup_joiner() ...@@ -568,13 +562,11 @@ cleanup_joiner()
# This means no setsid done in mysqld. # This means no setsid done in mysqld.
# We don't want to kill mysqld here otherwise. # We don't want to kill mysqld here otherwise.
if [[ $$ -eq $pgid ]];then if [[ $$ -eq $pgid ]];then
# This means a signal was delivered to the process. # This means a signal was delivered to the process.
# So, more cleanup. # So, more cleanup.
if [[ $estatus -ge 128 ]];then if [[ $estatus -ge 128 ]];then
kill -KILL -$$ || true kill -KILL -$$ || true
fi fi
fi fi
exit $estatus exit $estatus
...@@ -602,6 +594,7 @@ cleanup_donor() ...@@ -602,6 +594,7 @@ cleanup_donor()
fi fi
fi fi
rm -f ${DATA}/${IST_FILE} || true rm -f ${DATA}/${IST_FILE} || true
if [[ -n $progress && -p $progress ]];then if [[ -n $progress && -p $progress ]];then
...@@ -635,7 +628,6 @@ cleanup_donor() ...@@ -635,7 +628,6 @@ cleanup_donor()
fi fi
exit $estatus exit $estatus
} }
kill_xtrabackup() kill_xtrabackup()
...@@ -742,7 +734,6 @@ recv_joiner() ...@@ -742,7 +734,6 @@ recv_joiner()
fi fi
} }
send_donor() send_donor()
{ {
local dir=$1 local dir=$1
...@@ -754,7 +745,6 @@ send_donor() ...@@ -754,7 +745,6 @@ send_donor()
set -e set -e
popd 1>/dev/null popd 1>/dev/null
for ecode in "${RC[@]}";do for ecode in "${RC[@]}";do
if [[ $ecode -ne 0 ]];then if [[ $ecode -ne 0 ]];then
wsrep_log_error "Error while getting data from donor node: " \ wsrep_log_error "Error while getting data from donor node: " \
...@@ -762,7 +752,6 @@ send_donor() ...@@ -762,7 +752,6 @@ send_donor()
exit 32 exit 32
fi fi
done done
} }
# Returns the version string in a standardized format # Returns the version string in a standardized format
...@@ -822,7 +811,6 @@ monitor_process() ...@@ -822,7 +811,6 @@ monitor_process()
done done
} }
if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then
wsrep_log_error "innobackupex not in path: $PATH" wsrep_log_error "innobackupex not in path: $PATH"
exit 2 exit 2
...@@ -843,7 +831,6 @@ if ! check_for_version $XB_VERSION $XB_REQUIRED_VERSION; then ...@@ -843,7 +831,6 @@ if ! check_for_version $XB_VERSION $XB_REQUIRED_VERSION; then
exit 2 exit 2
fi fi
rm -f "${MAGIC_FILE}" rm -f "${MAGIC_FILE}"
if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then
...@@ -862,7 +849,6 @@ if [[ ${FORCE_FTWRL:-0} -eq 1 ]];then ...@@ -862,7 +849,6 @@ if [[ ${FORCE_FTWRL:-0} -eq 1 ]];then
iopts+=" --no-backup-locks " iopts+=" --no-backup-locks "
fi fi
INNOEXTRA="" INNOEXTRA=""
if [[ $ssyslog -eq 1 ]];then if [[ $ssyslog -eq 1 ]];then
...@@ -870,7 +856,6 @@ if [[ $ssyslog -eq 1 ]];then ...@@ -870,7 +856,6 @@ if [[ $ssyslog -eq 1 ]];then
if [[ ! -x `which logger` ]];then if [[ ! -x `which logger` ]];then
wsrep_log_error "logger not in path: $PATH. Ignoring" wsrep_log_error "logger not in path: $PATH. Ignoring"
else else
wsrep_log_info "Logging all stderr of SST/Innobackupex to syslog" wsrep_log_info "Logging all stderr of SST/Innobackupex to syslog"
exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE) exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE)
...@@ -1028,7 +1013,6 @@ then ...@@ -1028,7 +1013,6 @@ then
# innobackupex implicitly writes PID to fixed location in $xtmpdir # innobackupex implicitly writes PID to fixed location in $xtmpdir
XTRABACKUP_PID="$xtmpdir/xtrabackup_pid" XTRABACKUP_PID="$xtmpdir/xtrabackup_pid"
else # BYPASS FOR IST else # BYPASS FOR IST
wsrep_log_info "Bypassing the SST for IST" wsrep_log_info "Bypassing the SST for IST"
...@@ -1119,7 +1103,6 @@ then ...@@ -1119,7 +1103,6 @@ then
MAGIC_FILE="${STATDIR}/${INFO_FILE}" MAGIC_FILE="${STATDIR}/${INFO_FILE}"
recv_joiner $STATDIR "${stagemsg}-gtid" $stimeout 1 recv_joiner $STATDIR "${stagemsg}-gtid" $stimeout 1
if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null
then then
wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly." wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
...@@ -1138,7 +1121,6 @@ then ...@@ -1138,7 +1121,6 @@ then
jpid=$! jpid=$!
wsrep_log_info "Proceeding with SST" wsrep_log_info "Proceeding with SST"
wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories" wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories"
if [ "${OS}" = "FreeBSD" ]; then if [ "${OS}" = "FreeBSD" ]; then
find -E $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+ find -E $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+
...@@ -1164,12 +1146,9 @@ then ...@@ -1164,12 +1146,9 @@ then
fi fi
fi fi
TDATA=${DATA} TDATA=${DATA}
DATA="${DATA}/.sst" DATA="${DATA}/.sst"
MAGIC_FILE="${DATA}/${INFO_FILE}" MAGIC_FILE="${DATA}/${INFO_FILE}"
wsrep_log_info "Waiting for SST streaming to complete!" wsrep_log_info "Waiting for SST streaming to complete!"
monitor_process $jpid monitor_process $jpid
...@@ -1217,7 +1196,6 @@ then ...@@ -1217,7 +1196,6 @@ then
dcmd="xargs -n 2 qpress -T${nproc}d" dcmd="xargs -n 2 qpress -T${nproc}d"
fi fi
# Decompress the qpress files # Decompress the qpress files
wsrep_log_info "Decompression with $nproc threads" wsrep_log_info "Decompression with $nproc threads"
timeit "Joiner-Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd" timeit "Joiner-Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd"
...@@ -1235,7 +1213,6 @@ then ...@@ -1235,7 +1213,6 @@ then
fi fi
fi fi
if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then
BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG) BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG)
...@@ -1277,7 +1254,6 @@ then ...@@ -1277,7 +1254,6 @@ then
exit 22 exit 22
fi fi
else else
wsrep_log_info "${IST_FILE} received from donor: Running IST" wsrep_log_info "${IST_FILE} received from donor: Running IST"
fi fi
......
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
# Optional dependencies and options documented here: http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html # Optional dependencies and options documented here: http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
# Make sure to read that before proceeding! # Make sure to read that before proceeding!
. $(dirname $0)/wsrep_sst_common . $(dirname $0)/wsrep_sst_common
ealgo="" ealgo=""
...@@ -199,7 +196,6 @@ get_transfer() ...@@ -199,7 +196,6 @@ get_transfer()
fi fi
fi fi
fi fi
} }
get_footprint() get_footprint()
...@@ -278,7 +274,6 @@ get_stream() ...@@ -278,7 +274,6 @@ get_stream()
else else
strmcmd="tar cf - \${INFO_FILE} \${IST_FILE}" strmcmd="tar cf - \${INFO_FILE} \${IST_FILE}"
fi fi
fi fi
} }
...@@ -333,9 +328,9 @@ cleanup_donor() ...@@ -333,9 +328,9 @@ cleanup_donor()
wsrep_log_error "xtrabackup process is still running. Killing... " wsrep_log_error "xtrabackup process is still running. Killing... "
kill_xtrabackup kill_xtrabackup
fi fi
rm -f $XTRABACKUP_PID rm -f $XTRABACKUP_PID
fi fi
rm -f ${DATA}/${IST_FILE} rm -f ${DATA}/${IST_FILE}
if [[ -n $progress && -p $progress ]];then if [[ -n $progress && -p $progress ]];then
...@@ -503,6 +498,7 @@ then ...@@ -503,6 +498,7 @@ then
exit 1 exit 1
fi fi
done done
fi fi
echo "done ${WSREP_SST_OPT_GTID}" echo "done ${WSREP_SST_OPT_GTID}"
...@@ -600,6 +596,7 @@ then ...@@ -600,6 +596,7 @@ then
if [ ! -r "${DATA}/${IST_FILE}" ] if [ ! -r "${DATA}/${IST_FILE}" ]
then then
wsrep_log_info "Proceeding with SST" wsrep_log_info "Proceeding with SST"
wsrep_log_info "Removing existing ib_logfile files" wsrep_log_info "Removing existing ib_logfile files"
if [[ $incremental -ne 1 ]];then if [[ $incremental -ne 1 ]];then
rm -f ${DATA}/ib_logfile* rm -f ${DATA}/ib_logfile*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment