From: Martin Schwenke Date: Wed, 6 Jul 2016 04:28:06 +0000 (+1000) Subject: ctdb-scripts: Drop use of ctdb_check_counter from reclock event script X-Git-Tag: tdb-1.3.10~278 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0825eff3e3e1778144789105a9dbb3458f0725e4;p=thirdparty%2Fsamba.git ctdb-scripts: Drop use of ctdb_check_counter from reclock event script This makes the logic more obvious. Fix the (probably) accidental fall-through to the regular monitor failure. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/events.d/01.reclock b/ctdb/config/events.d/01.reclock index 45b2405ce94..cceb672c8e0 100755 --- a/ctdb/config/events.d/01.reclock +++ b/ctdb/config/events.d/01.reclock @@ -38,14 +38,16 @@ monitor) ) >/dev/null 2>&1 & ctdb_counter_incr - if ! ctdb_check_counter "quiet" -ge 200 ; then + num_fails=$(ctdb_counter_get) + if [ "$num_fails" -ge 200 ] ; then echo "Reclock file \"$CTDB_RECOVERY_LOCK\" can not be accessed. Shutting down." df sleep 1 $CTDB shutdown + exit 1 + elif [ "$num_fails" -ge 4 ] ; then + die "ERROR: ${num_fails} consecutive failures checking reclock" fi - - ctdb_check_counter "error" -gt 3 ;; esac diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.004.sh b/ctdb/tests/eventscripts/01.reclock.monitor.004.sh index fd185d1aa52..8ea0fd026fb 100755 --- a/ctdb/tests/eventscripts/01.reclock.monitor.004.sh +++ b/ctdb/tests/eventscripts/01.reclock.monitor.004.sh @@ -13,6 +13,6 @@ simple_test simple_test required_result 1 <