Add SST check to mysql_status

Conflicts:
	files/fuel-ha-utils/ocf/mysql-wss

Change-Id: Ib7dd20a0322ecb57748188290d5c52467b82c765
Closes-Bug: #1478310
(cherry picked from commit 0039c23202)
This commit is contained in:
Sergii Golovatiuk 2016-01-26 18:21:28 +01:00 committed by Rodion Tikunov
parent 490cdc76b6
commit 43de2a3169
1 changed files with 16 additions and 2 deletions

View File

@ -338,6 +338,10 @@ choose_master() {
done
MASTER=$(printf -- '%s\n' "${!TMP[@]}" | sort | head -1)
if [ -z $MASTER ]
then
ocf_log error "No master picked."
fi
ocf_log info "Choosed master: ${TMP[$MASTER]}"
echo ${TMP[$MASTER]}
}
@ -430,7 +434,13 @@ mysql_status() {
i=${2:-3}
sleeptime=${3:-5}
while [ $i -gt 0 ]; do
if [ -f "${OCF_RESKEY_datadir}"/sst_in_progress ]; then
ocf_log info 'SST is in progress'
return $OCF_SUCCESS
fi
if [ -f "$OCF_RESKEY_pid" ]; then
ocf_log info 'MySQL PID found'
break
fi
sleep $sleeptime
@ -438,7 +448,6 @@ mysql_status() {
ocf_log info "PIDFile ${OCF_RESKEY_pid} of MySQL server not found. Sleeping for $sleeptime seconds. ${i} retries left"
done
if [ $i -eq 0 ]; then
ocf_log $1 "MySQL is not running"
return $OCF_NOT_RUNNING;
@ -471,7 +480,10 @@ mysql_monitor() {
status_loglevel="info"
fi
update_node_gtid
if [ -f "${OCF_RESKEY_datadir}"/sst_in_progress ]; then
ocf_log info 'SST is in progress'
return $OCF_SUCCESS
fi
mysql_status $status_loglevel
rc=$?
@ -480,6 +492,8 @@ mysql_monitor() {
return $rc
fi
update_node_gtid
WSREP_CONNECTED=$($MYSQL $MYSQL_OPTIONS_TEST -s -N \
-e "SHOW STATUS LIKE 'wsrep_connected'" | awk '{print $NF}')
rc=$?