From 38898775e6f1fb25171c920f2d8bcce24ec51476 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 8 Jul 2019 13:30:06 +1000 Subject: [PATCH] ctdb-scripts: Drop monitoring of recovery lock The fcntl helper now does a more meaningful check. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/config/events/legacy/01.reclock.script | 28 ------------------- .../eventscripts/01.reclock.monitor.001.sh | 10 ------- .../eventscripts/01.reclock.monitor.002.sh | 10 ------- .../eventscripts/01.reclock.monitor.003.sh | 10 ------- .../eventscripts/01.reclock.monitor.004.sh | 18 ------------ .../eventscripts/01.reclock.monitor.005.sh | 28 ------------------- ctdb/tests/eventscripts/scripts/01.reclock.sh | 11 -------- 7 files changed, 115 deletions(-) delete mode 100755 ctdb/tests/eventscripts/01.reclock.monitor.001.sh delete mode 100755 ctdb/tests/eventscripts/01.reclock.monitor.002.sh delete mode 100755 ctdb/tests/eventscripts/01.reclock.monitor.003.sh delete mode 100755 ctdb/tests/eventscripts/01.reclock.monitor.004.sh delete mode 100755 ctdb/tests/eventscripts/01.reclock.monitor.005.sh diff --git a/ctdb/config/events/legacy/01.reclock.script b/ctdb/config/events/legacy/01.reclock.script index e14d8c22f48..2f4ed355e5e 100755 --- a/ctdb/config/events/legacy/01.reclock.script +++ b/ctdb/config/events/legacy/01.reclock.script @@ -36,39 +36,11 @@ esac case "$1" in init) - ctdb_counter_init - if [ -n "$CTDB_RECOVERY_LOCK" ] ; then d=$(dirname "$CTDB_RECOVERY_LOCK") mkdir -vp "$d" fi ;; - -monitor) - # Early exit if not using a reclock file - [ -n "$CTDB_RECOVERY_LOCK" ] || exit 0 - - # Try to stat the reclock file as a background process so that - # we don't block in case the cluster filesystem is unavailable - ( - if stat "$CTDB_RECOVERY_LOCK" ; then - # We could stat the file, reset the counter - ctdb_counter_init - fi - ) >/dev/null 2>&1 & - - ctdb_counter_incr - 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 - ;; esac exit 0 diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.001.sh b/ctdb/tests/eventscripts/01.reclock.monitor.001.sh deleted file mode 100755 index c495a47960e..00000000000 --- a/ctdb/tests/eventscripts/01.reclock.monitor.001.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -. "${TEST_SCRIPTS_DIR}/unit.sh" - -define_test "unset, check no-op" - -setup "" - -ok_null -simple_test diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.002.sh b/ctdb/tests/eventscripts/01.reclock.monitor.002.sh deleted file mode 100755 index 7d0dcbf0d19..00000000000 --- a/ctdb/tests/eventscripts/01.reclock.monitor.002.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -. "${TEST_SCRIPTS_DIR}/unit.sh" - -define_test "set to helper, check no-op" - -setup "!/some/recover/lock/helper foo" - -ok_null -simple_test diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.003.sh b/ctdb/tests/eventscripts/01.reclock.monitor.003.sh deleted file mode 100755 index 3e28ebbae7d..00000000000 --- a/ctdb/tests/eventscripts/01.reclock.monitor.003.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -. "${TEST_SCRIPTS_DIR}/unit.sh" - -define_test "set, exists" - -setup - -ok_null -simple_test diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.004.sh b/ctdb/tests/eventscripts/01.reclock.monitor.004.sh deleted file mode 100755 index 965f2466b16..00000000000 --- a/ctdb/tests/eventscripts/01.reclock.monitor.004.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -. "${TEST_SCRIPTS_DIR}/unit.sh" - -define_test "set, doesn't exist, 4 times" - -setup -rm -f "$CTDB_RECOVERY_LOCK" - -ok_null -simple_test -simple_test -simple_test - -required_result 1 </dev/null ; do - echo "Waiting for backgrounded ${script} to exit..." - (FAKE_SLEEP_REALLY=yes sleep 1) - done -} - setup () { if [ $# -eq 1 ] ; then @@ -22,6 +13,4 @@ setup () recovery lock = $CTDB_RECOVERY_LOCK EOF fi - - test_cleanup cleanup_reclock } -- 2.47.3