File tree Expand file tree Collapse file tree 3 files changed +46
-2
lines changed Expand file tree Collapse file tree 3 files changed +46
-2
lines changed Original file line number Diff line number Diff 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+
647668if [[ ! -x ` which $INNOBACKUPEX_BIN ` ]]; then
648669 wsrep_log_error " ${INNOBACKUPEX_BIN} not in path: $PATH "
649670 exit 2
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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
805826if [[ ! -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
You can’t perform that action at this time.
0 commit comments