Commit fbd88291 authored by Julius Goryavsky's avatar Julius Goryavsky

galera SST scripts: removing obsolete xtrabackup_pid support

Removed handling of the long-unsupported xtrabackup_pid file,
as it is not even created by modern versions of mariabackup.
Instead, added stopping of the asynchronous process that
mariabackup runs (if it is still active) to the exception
handler.
parent 5cb436e0
......@@ -687,16 +687,16 @@ cleanup_at_exit()
fi
if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
wsrep_log_info "Removing the sst_in_progress file"
wsrep_cleanup_progress_file
else
if [ -n "$BACKUP_PID" ]; then
if check_pid "$BACKUP_PID" 1; then
if ps -p $BACKUP_PID >/dev/null 2>&1; then
wsrep_log_error \
"mariadb-backup process is still running. Killing..."
cleanup_pid $CHECK_PID "$BACKUP_PID"
cleanup_pid $CHECK_PID
fi
fi
wsrep_log_info "Removing the sst_in_progress file"
wsrep_cleanup_progress_file
else
[ -f "$DATA/$IST_FILE" ] && rm -f "$DATA/$IST_FILE" || :
fi
......@@ -906,14 +906,14 @@ monitor_process()
local sst_stream_pid=$1
while :; do
if ! ps -p "$WSREP_SST_OPT_PARENT" >/dev/null 2>&1; then
if ! ps -p $WSREP_SST_OPT_PARENT >/dev/null 2>&1; then
wsrep_log_error \
"Parent mysqld process (PID: $WSREP_SST_OPT_PARENT)" \
"terminated unexpectedly."
kill -- -"$WSREP_SST_OPT_PARENT"
kill -- -$WSREP_SST_OPT_PARENT
exit 32
fi
if ! ps -p "$sst_stream_pid" >/dev/null 2>&1; then
if ! ps -p $sst_stream_pid >/dev/null 2>&1; then
break
fi
sleep 0.1
......@@ -1073,7 +1073,7 @@ SST_PID="$DATA/wsrep_sst.pid"
# give some time for previous SST to complete:
check_round=0
while check_pid "$SST_PID" 0; do
while check_pid "$SST_PID"; do
wsrep_log_info "previous SST is not completed, waiting for it to exit"
check_round=$(( check_round+1 ))
if [ $check_round -eq 30 ]; then
......@@ -1220,9 +1220,6 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
exit 22
fi
# mariadb-backup implicitly writes PID to fixed location in $xtmpdir
BACKUP_PID="$xtmpdir/xtrabackup_pid"
else # BYPASS FOR IST
wsrep_log_info "Bypassing the SST for IST"
......@@ -1402,7 +1399,7 @@ else # joiner
fi
mkdir -p "$DATA/.sst"
(recv_joiner "$DATA/.sst" "$stagemsg-SST" 0 0 0) &
jpid=$!
BACKUP_PID=$!
wsrep_log_info "Proceeding with SST"
get_binlog
......@@ -1447,6 +1444,7 @@ else # joiner
# Deleting files from previous SST and legacy files from old versions:
[ -f "$DATA/xtrabackup_binary" ] && rm -f "$DATA/xtrabackup_binary"
[ -f "$DATA/xtrabackup_pid" ] && rm -f "$DATA/xtrabackup_pid"
[ -f "$DATA/xtrabackup_checkpoints" ] && rm -f "$DATA/xtrabackup_checkpoints"
[ -f "$DATA/xtrabackup_info" ] && rm -f "$DATA/xtrabackup_info"
[ -f "$DATA/xtrabackup_slave_info" ] && rm -f "$DATA/xtrabackup_slave_info"
......@@ -1457,7 +1455,8 @@ else # joiner
MAGIC_FILE="$DATA/$INFO_FILE"
wsrep_log_info "Waiting for SST streaming to complete!"
monitor_process $jpid
monitor_process $BACKUP_PID
BACKUP_PID=""
if [ ! -s "$DATA/xtrabackup_checkpoints" ]; then
wsrep_log_error "xtrabackup_checkpoints missing," \
......
......@@ -351,7 +351,7 @@ SST_PID="$DATA/wsrep_sst.pid"
# give some time for previous SST to complete:
check_round=0
while check_pid "$SST_PID" 0; do
while check_pid "$SST_PID"; do
wsrep_log_info "Previous SST is not completed, waiting for it to exit"
check_round=$(( check_round+1 ))
if [ $check_round -eq 20 ]; then
......@@ -866,19 +866,18 @@ EOF
echo "ready $ADDR:$RSYNC_PORT/$MODULE"
MYSQLD_PID="$WSREP_SST_OPT_PARENT"
# wait for SST to complete by monitoring magic file
while [ ! -r "$MAGIC_FILE" ] && check_pid "$TRANSFER_PID" && \
ps -p $MYSQLD_PID >/dev/null 2>&1
ps -p $WSREP_SST_OPT_PARENT >/dev/null 2>&1
do
sleep 1
done
if ! ps -p $MYSQLD_PID >/dev/null 2>&1; then
if ! ps -p $WSREP_SST_OPT_PARENT >/dev/null 2>&1; then
wsrep_log_error \
"Parent mysqld process (PID: $MYSQLD_PID) terminated unexpectedly."
kill -- -$MYSQLD_PID
"Parent mysqld process (PID: $WSREP_SST_OPT_PARENT)" \
"terminated unexpectedly."
kill -- -$WSREP_SST_OPT_PARENT
sleep 1
exit 32
fi
......
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