Skip to content

Commit e08ddcc

Browse files
authored
Merge pull request #793 from codership/10.1-MDEV-15442
MDEV-15442 xtrabackup-v2 SST donor stuck in DONOR/DESYNCED state when…
2 parents fe9f2f4 + 7a7a619 commit e08ddcc

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

scripts/wsrep_sst_mariabackup.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,27 @@ send_donor()
644644

645645
}
646646

647+
monitor_process()
648+
{
649+
local sst_stream_pid=$1
650+
651+
while true ; do
652+
653+
if ! ps --pid "${WSREP_SST_OPT_PARENT}" &>/dev/null; then
654+
wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
655+
kill -- -"${WSREP_SST_OPT_PARENT}"
656+
exit 32
657+
fi
658+
659+
if ! ps --pid "${sst_stream_pid}" &>/dev/null; then
660+
break
661+
fi
662+
663+
sleep 0.1
664+
665+
done
666+
}
667+
647668
if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then
648669
wsrep_log_error "${INNOBACKUPEX_BIN} not in path: $PATH"
649670
exit 2
@@ -932,7 +953,7 @@ then
932953

933954
MAGIC_FILE="${DATA}/${INFO_FILE}"
934955
wsrep_log_info "Waiting for SST streaming to complete!"
935-
wait $jpid
956+
monitor_process $jpid
936957

937958
get_proc
938959

scripts/wsrep_sst_rsync.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ EOF
329329
then
330330
wsrep_log_error \
331331
"Parent mysqld process (PID:$MYSQLD_PID) terminated unexpectedly."
332+
kill -- -"${MYSQLD_PID}"
333+
sleep 1
332334
exit 32
333335
fi
334336

scripts/wsrep_sst_xtrabackup-v2.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,27 @@ check_for_version()
801801
fi
802802
}
803803

804+
monitor_process()
805+
{
806+
local sst_stream_pid=$1
807+
808+
while true ; do
809+
810+
if ! ps --pid "${WSREP_SST_OPT_PARENT}" &>/dev/null; then
811+
wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly."
812+
kill -- -"${WSREP_SST_OPT_PARENT}"
813+
exit 32
814+
fi
815+
816+
if ! ps --pid "${sst_stream_pid}" &>/dev/null; then
817+
break
818+
fi
819+
820+
sleep 0.1
821+
822+
done
823+
}
824+
804825

805826
if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then
806827
wsrep_log_error "innobackupex not in path: $PATH"
@@ -1102,7 +1123,7 @@ then
11021123

11031124
MAGIC_FILE="${DATA}/${INFO_FILE}"
11041125
wsrep_log_info "Waiting for SST streaming to complete!"
1105-
wait $jpid
1126+
monitor_process $jpid
11061127

11071128
get_proc
11081129

0 commit comments

Comments
 (0)