diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-01-08 18:22:43 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-01-08 18:22:43 +0200 |
commit | e2b585c1c5258065b89cd002fd259685f0fe6f09 (patch) | |
tree | cbe1cfa1fd4d5533623fe4c91a2cecbe54dbab34 /scripts | |
parent | 83c81d8991fd72fb8af54172c612310e885720f5 (diff) | |
parent | 38f1c9df321304c168d67151f3554de2b4269beb (diff) | |
download | mariadb-git-e2b585c1c5258065b89cd002fd259685f0fe6f09.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/wsrep_sst_mariabackup.sh | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index bc875a0dc03..4b778ea9d38 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -22,6 +22,7 @@ . $(dirname $0)/wsrep_sst_common +OS=$(uname) ealgo="" ekey="" ekeyfile="" @@ -82,7 +83,7 @@ fi pcmd="pv $pvopts" declare -a RC -INNOBACKUPEX_BIN=mariabackup +INNOBACKUPEX_BIN=$(which mariabackup) XBSTREAM_BIN=mbstream XBCRYPT_BIN=xbcrypt # Not available in MariaBackup @@ -327,6 +328,7 @@ read_cnf() rebuild=$(parse_cnf sst rebuild 0) ttime=$(parse_cnf sst time 0) cpat=$(parse_cnf sst cpat '.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$') + [[ $OS == "FreeBSD" ]] && cpat=$(parse_cnf sst cpat '.*galera\.cache$|.*sst_in_progress$|.*\.sst$|.*gvwstate\.dat$|.*grastate\.dat$|.*\.err$|.*\.log$|.*RPM_UPGRADE_MARKER$|.*RPM_UPGRADE_HISTORY$') ealgo=$(parse_cnf xtrabackup encrypt "") ekey=$(parse_cnf xtrabackup encrypt-key "") ekeyfile=$(parse_cnf xtrabackup encrypt-key-file "") @@ -527,7 +529,11 @@ wait_for_listen() local MODULE=$3 for i in {1..50} do - ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break + 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 + fi sleep 0.2 done echo "ready ${ADDR}/${MODULE}//$sst_ver" @@ -639,13 +645,12 @@ monitor_process() while true ; do - if ! ps --pid "${WSREP_SST_OPT_PARENT}" &>/dev/null; then + if ! ps -p "${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 + if ! ps -p "${sst_stream_pid}" &>/dev/null; then break fi @@ -941,7 +946,11 @@ then wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories" - find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -regex $cpat -prune -o -exec rm -rfv {} 1>&2 \+ + 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 tempdir=$(parse_cnf mysqld log-bin "") if [[ -n ${tempdir:-} ]];then |