diff options
author | Daniel Black <daniel.black@au1.ibm.com> | 2018-02-21 19:38:57 +0530 |
---|---|---|
committer | Sachin Setiya <sachinsetia1001@gmail.com> | 2018-02-21 19:48:18 +0530 |
commit | 4e6dab94d0931eafba502f5a91da29a54e75bb33 (patch) | |
tree | 9818aa1ccde8d24f5208e08c9be100ea4c914665 | |
parent | 56d6776524909b5bd413996cb703e099024105a5 (diff) | |
download | mariadb-git-4e6dab94d0931eafba502f5a91da29a54e75bb33.tar.gz |
MDEV-10.1.31 does not join an existing cluster with SST xtrabackup-v2
Analysis:- The problem is the change in the implementation of wait_for_listen
in wsrep_sst_xtrabackup-v2.sh. The new script uses lsof which will always
exit with an error code if it can't find all the items, and because the
script has the -e option set in the hashbang line (#!/bin/bash -ue), the
script will abort right after running lsof if lsof can't find even a single
item among all the items listed in its arguments. This will happen even if
socat is running and listening, because it can't find nc. The loop in
wait_for_listen will therefore always quit after one iteration without
writing the "ready" line to signal the parent.
Solution:- We will or the lsof with true.
Patch Credit :Daniel Black and David Wang
-rw-r--r-- | scripts/wsrep_sst_xtrabackup-v2.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh index 64dd182e2f2..9104daf19bc 100644 --- a/scripts/wsrep_sst_xtrabackup-v2.sh +++ b/scripts/wsrep_sst_xtrabackup-v2.sh @@ -644,7 +644,7 @@ wait_for_listen() for i in {1..300} do - LSOF_OUT=$(lsof -sTCP:LISTEN -i TCP:${PORT} -a -c nc -c socat -F c) + LSOF_OUT=$(lsof -sTCP:LISTEN -i TCP:${PORT} -a -c nc -c socat -F c 2> /dev/null || :) [ -n "${LSOF_OUT}" ] && break sleep 0.2 done |