summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-02-26 10:49:19 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2016-02-26 10:49:19 -0500
commit66832b619510f5b9724d8db1eac48bdafb9225e9 (patch)
treead100faa90fd88bbb7734833fac63599714b9004 /scripts
parent0251232f8c3bca33b4dd15d6668105f3de9d024d (diff)
downloadmariadb-git-66832b619510f5b9724d8db1eac48bdafb9225e9.tar.gz
MDEV-9598: Donor's rsync SST script hangs if FTWRL fails
During SST, since wsrep_sst_rsync waits for mysqld to create "tables_flushed" file after it has successfully executed FTWRL, it would wait forever if FTWRL fails. Fixed by introducing a mechanism to report failure to the script.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/wsrep_sst_rsync.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index a93ab940593..7e895aa4eb2 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -127,7 +127,10 @@ then
then
FLUSHED="$WSREP_SST_OPT_DATA/tables_flushed"
+ ERROR="$WSREP_SST_OPT_DATA/sst_error"
+
rm -rf "$FLUSHED"
+ rm -rf "$ERROR"
# Use deltaxfer only for WAN
inv=$(basename $0)
@@ -137,10 +140,20 @@ then
echo "flush tables"
# Wait for :
- # (a) tables to be flushed, and
- # (b) state ID & wsrep_gtid_domain_id to be written to the file.
+ # (a) Tables to be flushed, AND
+ # (b) Cluster state ID & wsrep_gtid_domain_id to be written to the file, OR
+ # (c) ERROR file, in case flush tables operation failed.
+
while [ ! -r "$FLUSHED" ] && ! grep -q ':' "$FLUSHED" >/dev/null 2>&1
do
+ # Check whether ERROR file exists.
+ if [ -f "$ERROR" ]
+ then
+ # Flush tables operation failed.
+ rm -rf "$ERROR"
+ exit 255
+ fi
+
sleep 0.2
done