Fix OCF MySQL monitor

Return success if SST detected, otherwise check status
and return error if it is not OK.

Closes-bug: #1574999

Change-Id: I5ee7807821ae1f21bcb3c74e15338acb8bb91ea1
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
Bogdan Dobrelya 2016-05-06 17:30:21 +02:00 committed by Sergii Golovatiuk
parent 1a43fd1e22
commit 84263cb37f
1 changed files with 5 additions and 13 deletions

View File

@ -537,21 +537,13 @@ mysql_monitor() {
status_loglevel="info"
fi
check_if_sst
rc=$?
[ $rc -eq $OCF_SUCCESS ] && return $rc
mysql_status $status_loglevel
rc=$?
check_if_sst
rc2=$?
if [ $rc2 -eq $OCF_SUCCESS -a $rc -ne $OCF_SUCCESS ] ; then
# The sst_in_progress file isn't removed if mysqld has died and shall be purged
ocf_log warn "${LH} found and purged a stale sst_in_progress file"
rm -f "${OCF_RESKEY_datadir}/sst_in_progress"
elif [ $rc2 -eq $OCF_SUCCESS ]; then
return $OCF_SUCCESS
fi
if [ $rc -ne $OCF_SUCCESS ]; then
return $rc
fi
[ $rc -eq $OCF_SUCCESS ] || return $rc
update_node_gtid