From 696219351246050311a82903b5eba898db672288 Mon Sep 17 00:00:00 2001 From: Vladimir Kuklin Date: Tue, 18 Feb 2014 20:01:48 +0400 Subject: [PATCH] Add sleep/retry cycle for galera OCF script Change-Id: I1a0e3758a785acf5013eb65e27b653e8063f8044 Closes-bug: #1281625 --- deployment/puppet/galera/files/ocf/mysql-wss | 32 ++++++++++++++------ deployment/puppet/galera/manifests/init.pp | 6 ++-- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/deployment/puppet/galera/files/ocf/mysql-wss b/deployment/puppet/galera/files/ocf/mysql-wss index 53b9dfc9a5..c340fc9da5 100644 --- a/deployment/puppet/galera/files/ocf/mysql-wss +++ b/deployment/puppet/galera/files/ocf/mysql-wss @@ -362,12 +362,12 @@ whether a node is usable for clients to read from. - - - - - - + + + + + + @@ -882,9 +882,23 @@ mysql_validate() { } mysql_status() { - if [ ! -e $OCF_RESKEY_pid ]; then - ocf_log $1 "MySQL is not running" - return $OCF_NOT_RUNNING; + i=5 + sleeptime=5 + while [ $i -gt 0 ] + do + if [ ! -e $OCF_RESKEY_pid ]; then + ocf_log info "PIDFile ${OCF_RESKEY_pid} of MySQL server not found. Sleeping for $sleeptime seconds. $(( i-1 )) retries left" + sleep $sleeptime + else + break + fi + let i=$i-1 + done + + if [ $i -eq 0 ] + then + ocf_log $1 "MySQL is not running" + return $OCF_NOT_RUNNING; fi pid=`cat $OCF_RESKEY_pid`; diff --git a/deployment/puppet/galera/manifests/init.pp b/deployment/puppet/galera/manifests/init.pp index 7b3ca2b34c..49af0cfd23 100644 --- a/deployment/puppet/galera/manifests/init.pp +++ b/deployment/puppet/galera/manifests/init.pp @@ -163,13 +163,13 @@ class galera ( operations => { 'monitor' => { 'interval' => '60', - 'timeout' => '30' + 'timeout' => '55' }, 'start' => { - 'timeout' => '450' + 'timeout' => '475' }, 'stop' => { - 'timeout' => '150' + 'timeout' => '175' }, }, }