mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
@ -194,9 +194,9 @@ case "$1" in
|
||||
shift
|
||||
;;
|
||||
'--binlog-index')
|
||||
WSREP_SST_OPT_BINLOG_INDEX="$2"
|
||||
shift
|
||||
;;
|
||||
WSREP_SST_OPT_BINLOG_INDEX="$2"
|
||||
shift
|
||||
;;
|
||||
'--gtid-domain-id')
|
||||
readonly WSREP_SST_OPT_GTID_DOMAIN_ID="$2"
|
||||
shift
|
||||
@ -298,11 +298,11 @@ fi
|
||||
|
||||
wsrep_defaults="$WSREP_SST_OPT_DEFAULT"
|
||||
if [ -n "$wsrep_defaults" ]; then
|
||||
wsrep_defaults="$wsrep_defaults "
|
||||
wsrep_defaults="$wsrep_defaults "
|
||||
fi
|
||||
wsrep_defaults="$wsrep_defaults$WSREP_SST_OPT_EXTRA_DEFAULT"
|
||||
if [ -n "$wsrep_defaults" ]; then
|
||||
wsrep_defaults="$wsrep_defaults "
|
||||
wsrep_defaults="$wsrep_defaults "
|
||||
fi
|
||||
readonly WSREP_SST_OPT_CONF="$wsrep_defaults$WSREP_SST_OPT_SUFFIX_DEFAULT"
|
||||
readonly MY_PRINT_DEFAULTS="$MY_PRINT_DEFAULTS $WSREP_SST_OPT_CONF"
|
||||
|
@ -87,8 +87,8 @@ set +e
|
||||
INNOBACKUPEX_BIN=$(which mariabackup)
|
||||
if test -z $INNOBACKUPEX_BIN
|
||||
then
|
||||
wsrep_log_error 'mariabackup binary not found in $PATH'
|
||||
exit 42
|
||||
wsrep_log_error 'mariabackup binary not found in $PATH'
|
||||
exit 42
|
||||
fi
|
||||
set -e
|
||||
XBSTREAM_BIN=mbstream
|
||||
@ -182,9 +182,9 @@ get_transfer()
|
||||
fi
|
||||
|
||||
if [[ $tfmt == 'nc' ]];then
|
||||
wsrep_check_programs nc
|
||||
|
||||
wsrep_check_programs nc
|
||||
wsrep_log_info "Using netcat as streamer"
|
||||
|
||||
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
|
||||
if nc -h 2>&1 | grep -q ncat;then
|
||||
# Ncat
|
||||
@ -215,9 +215,8 @@ get_transfer()
|
||||
tcmd_extra=""
|
||||
if nc -h 2>&1 | grep -qw -- -N; then
|
||||
tcmd_extra+="-N"
|
||||
wsrep_log_info "Using nc -N"
|
||||
wsrep_log_info "Using nc -N"
|
||||
fi
|
||||
|
||||
# netcat doesn't understand [] around IPv6 address
|
||||
if nc -h 2>&1 | grep -q ncat;then
|
||||
# Ncat
|
||||
@ -235,7 +234,7 @@ get_transfer()
|
||||
fi
|
||||
else
|
||||
tfmt='socat'
|
||||
wsrep_check_programs socat
|
||||
wsrep_check_programs socat
|
||||
wsrep_log_info "Using socat as streamer"
|
||||
|
||||
if [[ $encrypt -eq 2 || $encrypt -eq 3 ]] && ! socat -V | grep -q "WITH_OPENSSL 1";then
|
||||
@ -281,7 +280,6 @@ get_transfer()
|
||||
tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=${tpem},key=${tkey},cafile=${tcert}${sockopt}"
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
|
||||
tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio"
|
||||
@ -290,7 +288,6 @@ get_transfer()
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
parse_cnf()
|
||||
@ -324,7 +321,6 @@ get_footprint()
|
||||
|
||||
adjust_progress()
|
||||
{
|
||||
|
||||
if ! command -v pv >/dev/null;then
|
||||
wsrep_log_error "pv not found in path: $PATH"
|
||||
wsrep_log_error "Disabling all progress/rate-limiting"
|
||||
@ -426,7 +422,6 @@ get_stream()
|
||||
else
|
||||
strmcmd="tar cf - \${INFO_FILE} "
|
||||
fi
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
@ -458,6 +453,7 @@ cleanup_joiner()
|
||||
wsrep_log_info "Cleaning up fifo file $progress"
|
||||
rm $progress
|
||||
fi
|
||||
|
||||
if [[ -n ${STATDIR:-} ]];then
|
||||
[[ -d $STATDIR ]] && rm -rf $STATDIR
|
||||
fi
|
||||
@ -468,13 +464,11 @@ cleanup_joiner()
|
||||
# This means no setsid done in mysqld.
|
||||
# We don't want to kill mysqld here otherwise.
|
||||
if [[ $$ -eq $pgid ]];then
|
||||
|
||||
# This means a signal was delivered to the process.
|
||||
# So, more cleanup.
|
||||
if [[ $estatus -ge 128 ]];then
|
||||
kill -KILL -$$ || true
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
exit $estatus
|
||||
@ -500,8 +494,8 @@ cleanup_donor()
|
||||
wsrep_log_error "xtrabackup process is still running. Killing..."
|
||||
kill_xtrabackup
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
rm -f ${DATA}/${IST_FILE} || true
|
||||
|
||||
if [[ -n $progress && -p $progress ]];then
|
||||
@ -525,17 +519,14 @@ cleanup_donor()
|
||||
# This means no setsid done in mysqld.
|
||||
# We don't want to kill mysqld here otherwise.
|
||||
if [[ $$ -eq $pgid ]];then
|
||||
|
||||
# This means a signal was delivered to the process.
|
||||
# So, more cleanup.
|
||||
if [[ $estatus -ge 128 ]];then
|
||||
kill -KILL -$$ || true
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
exit $estatus
|
||||
|
||||
}
|
||||
|
||||
kill_xtrabackup()
|
||||
@ -565,7 +556,7 @@ wait_for_listen()
|
||||
local MODULE=$3
|
||||
for i in {1..50}
|
||||
do
|
||||
if [ "$OS" = "FreeBSD" ];then
|
||||
if [ "$OS" = "FreeBSD" ];then
|
||||
sockstat -46lp $PORT | grep -qE "^[^ ]* *(socat|nc) *[^ ]* *[^ ]* *[^ ]* *[^ ]*:$PORT" && break
|
||||
else
|
||||
ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break
|
||||
@ -632,7 +623,7 @@ recv_joiner()
|
||||
|
||||
if [[ ${RC[0]} -eq 124 ]];then
|
||||
wsrep_log_error "Possible timeout in receiving first data from "
|
||||
"donor in gtid stage: exit codes: ${RC[@]}"
|
||||
"donor in gtid stage: exit codes: ${RC[@]}"
|
||||
exit 32
|
||||
fi
|
||||
|
||||
@ -653,7 +644,6 @@ recv_joiner()
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
send_donor()
|
||||
{
|
||||
local dir=$1
|
||||
@ -665,7 +655,6 @@ send_donor()
|
||||
set -e
|
||||
popd 1>/dev/null
|
||||
|
||||
|
||||
for ecode in "${RC[@]}";do
|
||||
if [[ $ecode -ne 0 ]];then
|
||||
wsrep_log_error "Error while getting data from donor node: " \
|
||||
@ -673,7 +662,6 @@ send_donor()
|
||||
exit 32
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
monitor_process()
|
||||
@ -681,18 +669,14 @@ monitor_process()
|
||||
local sst_stream_pid=$1
|
||||
|
||||
while true ; do
|
||||
|
||||
if ! ps -p "${WSREP_SST_OPT_PARENT}" &>/dev/null; then
|
||||
wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
|
||||
exit 32
|
||||
fi
|
||||
|
||||
if ! ps -p "${sst_stream_pid}" &>/dev/null; then
|
||||
break
|
||||
fi
|
||||
|
||||
sleep 0.1
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
@ -751,7 +735,6 @@ if [[ $ssyslog -eq 1 ]];then
|
||||
if ! command -v logger >/dev/null;then
|
||||
wsrep_log_error "logger not in path: $PATH. Ignoring"
|
||||
else
|
||||
|
||||
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)
|
||||
@ -794,7 +777,6 @@ then
|
||||
else
|
||||
newfile=${INNOAPPLYLOG}.${ARCHIVETIMESTAMP}
|
||||
fi
|
||||
|
||||
wsrep_log_info "Moving ${INNOAPPLYLOG} to ${newfile}"
|
||||
mv "${INNOAPPLYLOG}" "${newfile}"
|
||||
gzip "${newfile}"
|
||||
@ -827,12 +809,12 @@ then
|
||||
mv "${INNOBACKUPLOG}" "${newfile}"
|
||||
gzip "${newfile}"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
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}"
|
||||
INNOBACKUP="${INNOBACKUPEX_BIN} ${WSREP_SST_OPT_CONF} --backup $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt --target-dir=\$itmpdir 2> ${INNOBACKUPLOG}"
|
||||
|
||||
fi
|
||||
|
||||
get_stream
|
||||
@ -939,7 +921,6 @@ then
|
||||
# innobackupex implicitly writes PID to fixed location in $xtmpdir
|
||||
XTRABACKUP_PID="$xtmpdir/xtrabackup_pid"
|
||||
|
||||
|
||||
else # BYPASS FOR IST
|
||||
|
||||
wsrep_log_info "Bypassing the SST for IST"
|
||||
@ -1003,7 +984,6 @@ then
|
||||
|
||||
stagemsg="Joiner-Recv"
|
||||
|
||||
|
||||
sencrypted=1
|
||||
nthreads=1
|
||||
|
||||
@ -1048,8 +1028,7 @@ then
|
||||
|
||||
STATDIR=$(mktemp -d)
|
||||
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
|
||||
then
|
||||
@ -1070,11 +1049,11 @@ then
|
||||
wsrep_log_info "Proceeding with SST"
|
||||
|
||||
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 \+
|
||||
else
|
||||
find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+
|
||||
fi
|
||||
fi
|
||||
|
||||
tempdir=$LOG_BIN_ARG
|
||||
if [ -z "$tempdir" ]; then
|
||||
@ -1094,12 +1073,9 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
TDATA=${DATA}
|
||||
DATA="${DATA}/.sst"
|
||||
|
||||
|
||||
MAGIC_FILE="${DATA}/${INFO_FILE}"
|
||||
wsrep_log_info "Waiting for SST streaming to complete!"
|
||||
monitor_process $jpid
|
||||
@ -1127,7 +1103,7 @@ then
|
||||
|
||||
wsrep_log_info "Compressed qpress files found"
|
||||
|
||||
if ! command -v qpress >/dev/null;then
|
||||
if ! command -v qpress >/dev/null;then
|
||||
wsrep_log_error "qpress not found in path: $PATH"
|
||||
exit 22
|
||||
fi
|
||||
@ -1147,7 +1123,6 @@ then
|
||||
dcmd="xargs -n 2 qpress -T${nproc}d"
|
||||
fi
|
||||
|
||||
|
||||
# Decompress the qpress files
|
||||
wsrep_log_info "Decompression with $nproc threads"
|
||||
timeit "Joiner-Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd"
|
||||
@ -1165,7 +1140,6 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then
|
||||
|
||||
BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG)
|
||||
@ -1206,9 +1180,10 @@ then
|
||||
exit 22
|
||||
fi
|
||||
|
||||
|
||||
else
|
||||
|
||||
wsrep_log_info "${IST_FILE} received from donor: Running IST"
|
||||
|
||||
fi
|
||||
|
||||
if [[ ! -r ${MAGIC_FILE} ]];then
|
||||
@ -1217,6 +1192,7 @@ then
|
||||
fi
|
||||
wsrep_log_info "Galera co-ords from recovery: $(cat ${MAGIC_FILE})"
|
||||
cat "${MAGIC_FILE}" # Output : UUID:seqno wsrep_gtid_domain_id
|
||||
|
||||
wsrep_log_info "Total time on joiner: $totime seconds"
|
||||
fi
|
||||
|
||||
|
@ -100,12 +100,12 @@ SET_START_POSITION="SET GLOBAL wsrep_start_position='$WSREP_SST_OPT_GTID';"
|
||||
SET_WSREP_GTID_DOMAIN_ID=""
|
||||
if [ -n $WSREP_SST_OPT_GTID_DOMAIN_ID ]
|
||||
then
|
||||
SET_WSREP_GTID_DOMAIN_ID="
|
||||
SET @val = (SELECT GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME = 'WSREP_GTID_STRICT_MODE' AND GLOBAL_VALUE > 0);
|
||||
SET @stmt = IF (@val IS NOT NULL, 'SET GLOBAL WSREP_GTID_DOMAIN_ID=$WSREP_SST_OPT_GTID_DOMAIN_ID', 'SET @dummy = 0');
|
||||
PREPARE stmt FROM @stmt;
|
||||
EXECUTE stmt;
|
||||
DROP PREPARE stmt;"
|
||||
SET_WSREP_GTID_DOMAIN_ID="
|
||||
SET @val = (SELECT GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME = 'WSREP_GTID_STRICT_MODE' AND GLOBAL_VALUE > 0);
|
||||
SET @stmt = IF (@val IS NOT NULL, 'SET GLOBAL WSREP_GTID_DOMAIN_ID=$WSREP_SST_OPT_GTID_DOMAIN_ID', 'SET @dummy = 0');
|
||||
PREPARE stmt FROM @stmt;
|
||||
EXECUTE stmt;
|
||||
DROP PREPARE stmt;"
|
||||
fi
|
||||
|
||||
MYSQL="$MYSQL_CLIENT $WSREP_SST_OPT_CONF "\
|
||||
@ -132,16 +132,16 @@ SQL_LOG_BIN_OFF=""
|
||||
# Safety check
|
||||
if [ "${SERVER_VERSION%%.*}" != '5' ]
|
||||
then
|
||||
# If binary logging is enabled on the joiner node, we need to copy donor's
|
||||
# gtid_binlog_state to joiner. In order to do that, a RESET MASTER must be
|
||||
# executed to erase binary logs (if any). Binary logging should also be
|
||||
# turned off for the session so that gtid state does not get altered while
|
||||
# the dump gets replayed on joiner.
|
||||
if [[ "$LOG_BIN" == 'ON' ]]; then
|
||||
RESET_MASTER="RESET MASTER;"
|
||||
SET_GTID_BINLOG_STATE="SET @@global.gtid_binlog_state='$GTID_BINLOG_STATE';"
|
||||
SQL_LOG_BIN_OFF="SET @@session.sql_log_bin=OFF;"
|
||||
fi
|
||||
# If binary logging is enabled on the joiner node, we need to copy donor's
|
||||
# gtid_binlog_state to joiner. In order to do that, a RESET MASTER must be
|
||||
# executed to erase binary logs (if any). Binary logging should also be
|
||||
# turned off for the session so that gtid state does not get altered while
|
||||
# the dump gets replayed on joiner.
|
||||
if [[ "$LOG_BIN" == 'ON' ]]; then
|
||||
RESET_MASTER="RESET MASTER;"
|
||||
SET_GTID_BINLOG_STATE="SET @@global.gtid_binlog_state='$GTID_BINLOG_STATE';"
|
||||
SQL_LOG_BIN_OFF="SET @@session.sql_log_bin=OFF;"
|
||||
fi
|
||||
fi
|
||||
|
||||
# NOTE: we don't use --routines here because we're dumping mysql.proc table
|
||||
|
@ -74,8 +74,8 @@ check_pid_and_port()
|
||||
;;
|
||||
*)
|
||||
if ! which lsof > /dev/null; then
|
||||
wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed."
|
||||
exit 2 # ENOENT
|
||||
wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed."
|
||||
exit 2 # ENOENT
|
||||
fi
|
||||
|
||||
local port_info="$(lsof -i :$rsync_port -Pn 2>/dev/null | \
|
||||
@ -107,15 +107,15 @@ is_local_ip()
|
||||
local get_addr_bin=`which ifconfig`
|
||||
if [ -z "$get_addr_bin" ]
|
||||
then
|
||||
get_addr_bin=`which ip`
|
||||
get_addr_bin="$get_addr_bin address show"
|
||||
# Add an slash at the end, so we don't get false positive : 172.18.0.4 matches 172.18.0.41
|
||||
# ip output format is "X.X.X.X/mask"
|
||||
address="${address}/"
|
||||
get_addr_bin=`which ip`
|
||||
get_addr_bin="$get_addr_bin address show"
|
||||
# Add an slash at the end, so we don't get false positive : 172.18.0.4 matches 172.18.0.41
|
||||
# ip output format is "X.X.X.X/mask"
|
||||
address="${address}/"
|
||||
else
|
||||
# Add an space at the end, so we don't get false positive : 172.18.0.4 matches 172.18.0.41
|
||||
# ifconfig output format is "X.X.X.X "
|
||||
address="$address "
|
||||
# Add an space at the end, so we don't get false positive : 172.18.0.4 matches 172.18.0.41
|
||||
# ifconfig output format is "X.X.X.X "
|
||||
address="$address "
|
||||
fi
|
||||
|
||||
$get_addr_bin | grep -F "$address" > /dev/null
|
||||
@ -373,11 +373,13 @@ EOF
|
||||
fi
|
||||
|
||||
else # BYPASS
|
||||
|
||||
wsrep_log_info "Bypassing state dump."
|
||||
|
||||
# Store donor's wsrep GTID (state ID) and wsrep_gtid_domain_id
|
||||
# (separated by a space).
|
||||
STATE="$WSREP_SST_OPT_GTID $WSREP_SST_OPT_GTID_DOMAIN_ID"
|
||||
|
||||
fi
|
||||
|
||||
echo "continue" # now server can resume updating data
|
||||
@ -461,22 +463,22 @@ EOF
|
||||
# If the IP is local listen only in it
|
||||
if is_local_ip "$RSYNC_ADDR"
|
||||
then
|
||||
RSYNC_EXTRA_ARGS="--address $RSYNC_ADDR"
|
||||
STUNNEL_ACCEPT="$RSYNC_ADDR:$RSYNC_PORT"
|
||||
RSYNC_EXTRA_ARGS="--address $RSYNC_ADDR"
|
||||
STUNNEL_ACCEPT="$RSYNC_ADDR:$RSYNC_PORT"
|
||||
else
|
||||
# Not local, possibly a NAT, listen on all interfaces
|
||||
RSYNC_EXTRA_ARGS=""
|
||||
STUNNEL_ACCEPT="$RSYNC_PORT"
|
||||
# Overwrite address with all
|
||||
RSYNC_ADDR="*"
|
||||
# Not local, possibly a NAT, listen on all interfaces
|
||||
RSYNC_EXTRA_ARGS=""
|
||||
STUNNEL_ACCEPT="$RSYNC_PORT"
|
||||
# Overwrite address with all
|
||||
RSYNC_ADDR="*"
|
||||
fi
|
||||
|
||||
if [ -z "$STUNNEL" ]
|
||||
then
|
||||
rsync --daemon --no-detach --port "$RSYNC_PORT" --config "$RSYNC_CONF" ${RSYNC_EXTRA_ARGS} &
|
||||
RSYNC_REAL_PID=$!
|
||||
rsync --daemon --no-detach --port "$RSYNC_PORT" --config "$RSYNC_CONF" ${RSYNC_EXTRA_ARGS} &
|
||||
RSYNC_REAL_PID=$!
|
||||
else
|
||||
cat << EOF > "$STUNNEL_CONF"
|
||||
cat << EOF > "$STUNNEL_CONF"
|
||||
key = $SSTKEY
|
||||
cert = $SSTCERT
|
||||
foreground = yes
|
||||
@ -488,9 +490,9 @@ accept = $STUNNEL_ACCEPT
|
||||
exec = $(which rsync)
|
||||
execargs = rsync --server --daemon --config=$RSYNC_CONF .
|
||||
EOF
|
||||
stunnel "$STUNNEL_CONF" &
|
||||
RSYNC_REAL_PID=$!
|
||||
RSYNC_PID=$STUNNEL_PID
|
||||
stunnel "$STUNNEL_CONF" &
|
||||
RSYNC_REAL_PID=$!
|
||||
RSYNC_PID=$STUNNEL_PID
|
||||
fi
|
||||
|
||||
until check_pid_and_port "$RSYNC_PID" "$RSYNC_REAL_PID" "$RSYNC_ADDR" "$RSYNC_PORT"
|
||||
@ -518,7 +520,6 @@ EOF
|
||||
|
||||
if ! [ -z $WSREP_SST_OPT_BINLOG ]
|
||||
then
|
||||
|
||||
OLD_PWD="$(pwd)"
|
||||
cd $BINLOG_DIRNAME
|
||||
|
||||
@ -532,14 +533,15 @@ EOF
|
||||
do
|
||||
if ! [ -z $WSREP_SST_OPT_BINLOG_INDEX ]
|
||||
echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_FILENAME}.index
|
||||
then
|
||||
then
|
||||
echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_INDEX_DIRNAME}/${BINLOG_INDEX_FILENAME}.index
|
||||
fi
|
||||
done
|
||||
fi
|
||||
cd "$OLD_PWD"
|
||||
|
||||
cd "$OLD_PWD"
|
||||
fi
|
||||
|
||||
if [ -r "$MAGIC_FILE" ]
|
||||
then
|
||||
# UUID:seqno & wsrep_gtid_domain_id is received here.
|
||||
@ -548,6 +550,7 @@ EOF
|
||||
# this message should cause joiner to abort
|
||||
echo "rsync process ended without creating '$MAGIC_FILE'"
|
||||
fi
|
||||
|
||||
wsrep_cleanup_progress_file
|
||||
# cleanup_joiner
|
||||
else
|
||||
|
@ -18,9 +18,6 @@
|
||||
# Documentation: http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
|
||||
# Make sure to read that before proceeding!
|
||||
|
||||
|
||||
|
||||
|
||||
. $(dirname $0)/wsrep_sst_common
|
||||
|
||||
ealgo=""
|
||||
@ -389,7 +386,6 @@ get_transfer()
|
||||
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}"
|
||||
fi
|
||||
|
||||
else
|
||||
if [[ $encrypt -eq 1 ]]; then
|
||||
wsrep_log_warning "**** WARNING **** encrypt=1 is deprecated and will be removed in a future release"
|
||||
@ -420,7 +416,6 @@ get_footprint()
|
||||
|
||||
adjust_progress()
|
||||
{
|
||||
|
||||
if [[ ! -x `which pv` ]];then
|
||||
wsrep_log_error "pv not found in path: $PATH"
|
||||
wsrep_log_error "Disabling all progress/rate-limiting"
|
||||
@ -470,7 +465,6 @@ read_cnf()
|
||||
scomp=$(parse_cnf sst compressor "")
|
||||
sdecomp=$(parse_cnf sst decompressor "")
|
||||
|
||||
|
||||
# Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html
|
||||
if [[ -z $ealgo ]];then
|
||||
ealgo=$(parse_cnf sst encrypt-algo "")
|
||||
@ -526,7 +520,6 @@ get_stream()
|
||||
else
|
||||
strmcmd="tar cf - \${INFO_FILE} "
|
||||
fi
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
@ -558,6 +551,7 @@ cleanup_joiner()
|
||||
wsrep_log_info "Cleaning up fifo file $progress"
|
||||
rm $progress
|
||||
fi
|
||||
|
||||
if [[ -n ${STATDIR:-} ]];then
|
||||
[[ -d $STATDIR ]] && rm -rf $STATDIR
|
||||
fi
|
||||
@ -568,13 +562,11 @@ cleanup_joiner()
|
||||
# This means no setsid done in mysqld.
|
||||
# We don't want to kill mysqld here otherwise.
|
||||
if [[ $$ -eq $pgid ]];then
|
||||
|
||||
# This means a signal was delivered to the process.
|
||||
# So, more cleanup.
|
||||
if [[ $estatus -ge 128 ]];then
|
||||
kill -KILL -$$ || true
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
exit $estatus
|
||||
@ -602,6 +594,7 @@ cleanup_donor()
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
rm -f ${DATA}/${IST_FILE} || true
|
||||
|
||||
if [[ -n $progress && -p $progress ]];then
|
||||
@ -635,7 +628,6 @@ cleanup_donor()
|
||||
fi
|
||||
|
||||
exit $estatus
|
||||
|
||||
}
|
||||
|
||||
kill_xtrabackup()
|
||||
@ -742,7 +734,6 @@ recv_joiner()
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
send_donor()
|
||||
{
|
||||
local dir=$1
|
||||
@ -754,7 +745,6 @@ send_donor()
|
||||
set -e
|
||||
popd 1>/dev/null
|
||||
|
||||
|
||||
for ecode in "${RC[@]}";do
|
||||
if [[ $ecode -ne 0 ]];then
|
||||
wsrep_log_error "Error while getting data from donor node: " \
|
||||
@ -762,7 +752,6 @@ send_donor()
|
||||
exit 32
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
# Returns the version string in a standardized format
|
||||
@ -822,7 +811,6 @@ monitor_process()
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then
|
||||
wsrep_log_error "innobackupex not in path: $PATH"
|
||||
exit 2
|
||||
@ -843,7 +831,6 @@ if ! check_for_version $XB_VERSION $XB_REQUIRED_VERSION; then
|
||||
exit 2
|
||||
fi
|
||||
|
||||
|
||||
rm -f "${MAGIC_FILE}"
|
||||
|
||||
if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then
|
||||
@ -862,7 +849,6 @@ if [[ ${FORCE_FTWRL:-0} -eq 1 ]];then
|
||||
iopts+=" --no-backup-locks "
|
||||
fi
|
||||
|
||||
|
||||
INNOEXTRA=""
|
||||
|
||||
if [[ $ssyslog -eq 1 ]];then
|
||||
@ -870,7 +856,6 @@ if [[ $ssyslog -eq 1 ]];then
|
||||
if [[ ! -x `which logger` ]];then
|
||||
wsrep_log_error "logger not in path: $PATH. Ignoring"
|
||||
else
|
||||
|
||||
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)
|
||||
@ -1028,7 +1013,6 @@ then
|
||||
# innobackupex implicitly writes PID to fixed location in $xtmpdir
|
||||
XTRABACKUP_PID="$xtmpdir/xtrabackup_pid"
|
||||
|
||||
|
||||
else # BYPASS FOR IST
|
||||
|
||||
wsrep_log_info "Bypassing the SST for IST"
|
||||
@ -1119,7 +1103,6 @@ then
|
||||
MAGIC_FILE="${STATDIR}/${INFO_FILE}"
|
||||
recv_joiner $STATDIR "${stagemsg}-gtid" $stimeout 1
|
||||
|
||||
|
||||
if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null
|
||||
then
|
||||
wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
|
||||
@ -1138,7 +1121,6 @@ then
|
||||
jpid=$!
|
||||
wsrep_log_info "Proceeding with SST"
|
||||
|
||||
|
||||
wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories"
|
||||
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 \+
|
||||
@ -1164,12 +1146,9 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
TDATA=${DATA}
|
||||
DATA="${DATA}/.sst"
|
||||
|
||||
|
||||
MAGIC_FILE="${DATA}/${INFO_FILE}"
|
||||
wsrep_log_info "Waiting for SST streaming to complete!"
|
||||
monitor_process $jpid
|
||||
@ -1217,7 +1196,6 @@ then
|
||||
dcmd="xargs -n 2 qpress -T${nproc}d"
|
||||
fi
|
||||
|
||||
|
||||
# Decompress the qpress files
|
||||
wsrep_log_info "Decompression with $nproc threads"
|
||||
timeit "Joiner-Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd"
|
||||
@ -1235,7 +1213,6 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then
|
||||
|
||||
BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG)
|
||||
@ -1277,7 +1254,6 @@ then
|
||||
exit 22
|
||||
fi
|
||||
|
||||
|
||||
else
|
||||
wsrep_log_info "${IST_FILE} received from donor: Running IST"
|
||||
fi
|
||||
|
@ -18,9 +18,6 @@
|
||||
# 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!
|
||||
|
||||
|
||||
|
||||
|
||||
. $(dirname $0)/wsrep_sst_common
|
||||
|
||||
ealgo=""
|
||||
@ -199,7 +196,6 @@ get_transfer()
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
get_footprint()
|
||||
@ -278,7 +274,6 @@ get_stream()
|
||||
else
|
||||
strmcmd="tar cf - \${INFO_FILE} \${IST_FILE}"
|
||||
fi
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
@ -333,9 +328,9 @@ cleanup_donor()
|
||||
wsrep_log_error "xtrabackup process is still running. Killing... "
|
||||
kill_xtrabackup
|
||||
fi
|
||||
|
||||
rm -f $XTRABACKUP_PID
|
||||
fi
|
||||
|
||||
rm -f ${DATA}/${IST_FILE}
|
||||
|
||||
if [[ -n $progress && -p $progress ]];then
|
||||
@ -503,6 +498,7 @@ then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
echo "done ${WSREP_SST_OPT_GTID}"
|
||||
@ -600,6 +596,7 @@ then
|
||||
if [ ! -r "${DATA}/${IST_FILE}" ]
|
||||
then
|
||||
wsrep_log_info "Proceeding with SST"
|
||||
|
||||
wsrep_log_info "Removing existing ib_logfile files"
|
||||
if [[ $incremental -ne 1 ]];then
|
||||
rm -f ${DATA}/ib_logfile*
|
||||
|
Reference in New Issue
Block a user