Add initial-timeout to SST

Bug #1292991 reported by Raghavendra D Prabhu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
Status tracked in 5.6
5.5
Fix Released
Undecided
Unassigned
5.6
Fix Released
Undecided
Unassigned
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
Undecided
Unassigned
5.6
Fix Released
Undecided
Unassigned

Bug Description

Initial timeout to receive packets from donor, so that if donor dies somewhere in between, joiner doesn't hang.

Tags: sst xtrabackup
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Set by default to 100 seconds, if set to 0, it is disabled. The
option will be sst-initial-timeout.

=== modified file 'scripts/wsrep_sst_xtrabackup-v2.sh'
--- scripts/wsrep_sst_xtrabackup-v2.sh 2014-03-09 14:03:38 +0000
+++ scripts/wsrep_sst_xtrabackup-v2.sh 2014-03-15 23:19:19 +0000
@@ -299,6 +299,7 @@
     iopts=$(parse_cnf sst inno-backup-opts "")
     iapts=$(parse_cnf sst inno-apply-opts "")
     impts=$(parse_cnf sst inno-move-opts "")
+ stimeout=$(parse_cnf sst sst-initial-timeout 100)
 }

 get_stream()
@@ -453,9 +454,19 @@
 {
     local dir=$1
     local msg=$2
+ local tmt=$3

     pushd ${dir} 1>/dev/null
     set +e
+
+ if [[ $tmt -gt 0 && -x `which timeout` ]];then
+ if timeout --help | grep -q -- '-k';then
+ tcmd="timeout -k $(( tmt+10 )) $tmt $tcmd"
+ else
+ tcmd="timeout $tmt $tcmd"
+ fi
+ fi
+
     timeit "$msg" "$tcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )"
     set -e
     popd 1>/dev/null
@@ -713,7 +724,7 @@

     STATDIR=$(mktemp -d)
     MAGIC_FILE="${STATDIR}/${INFO_FILE}"
- recv_joiner $STATDIR "${stagemsg}-gtid" 1
+ recv_joiner $STATDIR "${stagemsg}-gtid" 1 $stimeout

     if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null
     then
@@ -763,7 +774,7 @@

         MAGIC_FILE="${DATA}/${INFO_FILE}"
- recv_joiner $DATA "${stagemsg}-SST" 0
+ recv_joiner $DATA "${stagemsg}-SST" 0 0

         get_proc

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :
tags: added: sst xtrabackup
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXC-1650

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.