diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-01-23 15:53:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-23 15:53:58 +0200 |
commit | f4d798635ea294aadfe1961ea44c5c6a4350b267 (patch) | |
tree | 8d6ef0c92cc71a5edb425be51a26353c42f669fc | |
parent | 30b1fbda288af49a5eabb2050f1145d7d287e671 (diff) | |
parent | be83785d7363f1792d0be8a2e9c9b59c8e01392e (diff) | |
download | mariadb-git-f4d798635ea294aadfe1961ea44c5c6a4350b267.tar.gz |
Merge pull request #560 from grooverdan/10.1-MDEV-13789-freebsd-wsrep-sst-xtrabackup
MDEV-13789: FreeBSD wsrep_sst_xtrabackup-v2 - find compatibilty +lsof
-rw-r--r-- | scripts/wsrep_sst_xtrabackup-v2.sh | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh index 9284bf78019..a40bdec1342 100644 --- a/scripts/wsrep_sst_xtrabackup-v2.sh +++ b/scripts/wsrep_sst_xtrabackup-v2.sh @@ -97,6 +97,13 @@ MAGIC_FILE="${DATA}/${INFO_FILE}" # Setting the path for ss and ip export PATH="/usr/sbin:/sbin:$PATH" +OS=$(uname) + +if ! which lsof > /dev/null; then + wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed." + exit 2 # ENOENT +fi + timeit(){ local stage=$1 shift @@ -452,7 +459,11 @@ read_cnf() progress=$(parse_cnf sst progress "") rebuild=$(parse_cnf sst rebuild 0) ttime=$(parse_cnf sst time 0) - cpat=$(parse_cnf sst cpat '.*\.pem$\|.*init\.ok$\|.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$') + if [ "${OS}" = "FreeBSD" ]; then + cpat=$(parse_cnf sst cpat '.*\.pem$|.*init\.ok$|.*galera\.cache$|.*sst_in_progress$|.*\.sst$|.*gvwstate\.dat$|.*grastate\.dat$|.*\.err$|.*\.log$|.*RPM_UPGRADE_MARKER$|.*RPM_UPGRADE_HISTORY$') + else + cpat=$(parse_cnf sst cpat '.*\.pem$\|.*init\.ok$\|.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$') + fi ealgo=$(parse_cnf xtrabackup encrypt "") ekey=$(parse_cnf xtrabackup encrypt-key "") ekeyfile=$(parse_cnf xtrabackup encrypt-key-file "") @@ -654,10 +665,12 @@ wait_for_listen() local HOST=$1 local PORT=$2 local MODULE=$3 + local LSOF_OUT for i in {1..300} do - ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break + LSOF_OUT=$(lsof -sTCP:LISTEN -i TCP:${PORT} -a -c nc -c socat -F c) + [ -n "${LSOF_OUT}" ] && break sleep 0.2 done @@ -1072,7 +1085,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 -prune -regex $cpat -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 |