diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-07-16 08:56:28 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-07-16 08:56:28 +0300 |
commit | c0317e37ad1ea5abff4aab70e32395d4852a355a (patch) | |
tree | 6c6bb374b2f3820f88f03846db7ab40b6eb75c6a | |
parent | fe9f2f4bb63b379a532016c28c3771510061a47d (diff) | |
parent | 7a7a61998c60b8114994b29d5f649637be8139e0 (diff) | |
download | mariadb-git-bb-10.1-MDEV-15442.tar.gz |
Merge branch '10.1-MDEV-15442' of https://github.com/codership/mariadb-server into codership-10.1-MDEV-15442bb-10.1-MDEV-15442
-rw-r--r-- | scripts/wsrep_sst_mariabackup.sh | 23 | ||||
-rw-r--r-- | scripts/wsrep_sst_rsync.sh | 2 | ||||
-rw-r--r-- | scripts/wsrep_sst_xtrabackup-v2.sh | 23 |
3 files changed, 46 insertions, 2 deletions
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 549161aa8f3..ea0a6fc0d51 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -644,6 +644,27 @@ send_donor() } +monitor_process() +{ + local sst_stream_pid=$1 + + while true ; do + + if ! ps --pid "${WSREP_SST_OPT_PARENT}" &>/dev/null; then + wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly." + kill -- -"${WSREP_SST_OPT_PARENT}" + exit 32 + fi + + if ! ps --pid "${sst_stream_pid}" &>/dev/null; then + break + fi + + sleep 0.1 + + done +} + if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then wsrep_log_error "${INNOBACKUPEX_BIN} not in path: $PATH" exit 2 @@ -932,7 +953,7 @@ then MAGIC_FILE="${DATA}/${INFO_FILE}" wsrep_log_info "Waiting for SST streaming to complete!" - wait $jpid + monitor_process $jpid get_proc diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh index 3d76d1780e2..81120b66d5a 100644 --- a/scripts/wsrep_sst_rsync.sh +++ b/scripts/wsrep_sst_rsync.sh @@ -329,6 +329,8 @@ EOF then wsrep_log_error \ "Parent mysqld process (PID:$MYSQLD_PID) terminated unexpectedly." + kill -- -"${MYSQLD_PID}" + sleep 1 exit 32 fi diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh index 00efdaeebcf..99bbabbe9be 100644 --- a/scripts/wsrep_sst_xtrabackup-v2.sh +++ b/scripts/wsrep_sst_xtrabackup-v2.sh @@ -801,6 +801,27 @@ check_for_version() fi } +monitor_process() +{ + local sst_stream_pid=$1 + + while true ; do + + if ! ps --pid "${WSREP_SST_OPT_PARENT}" &>/dev/null; then + wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly." + kill -- -"${WSREP_SST_OPT_PARENT}" + exit 32 + fi + + if ! ps --pid "${sst_stream_pid}" &>/dev/null; then + break + fi + + sleep 0.1 + + done +} + if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then wsrep_log_error "innobackupex not in path: $PATH" @@ -1102,7 +1123,7 @@ then MAGIC_FILE="${DATA}/${INFO_FILE}" wsrep_log_info "Waiting for SST streaming to complete!" - wait $jpid + monitor_process $jpid get_proc |