]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Drop monitoring of recovery lock
authorMartin Schwenke <martin@meltin.net>
Mon, 8 Jul 2019 03:30:06 +0000 (13:30 +1000)
committerMartin Schwenke <martins@samba.org>
Fri, 26 Jul 2019 03:34:17 +0000 (03:34 +0000)
The fcntl helper now does a more meaningful check.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/events/legacy/01.reclock.script
ctdb/tests/eventscripts/01.reclock.monitor.001.sh [deleted file]
ctdb/tests/eventscripts/01.reclock.monitor.002.sh [deleted file]
ctdb/tests/eventscripts/01.reclock.monitor.003.sh [deleted file]
ctdb/tests/eventscripts/01.reclock.monitor.004.sh [deleted file]
ctdb/tests/eventscripts/01.reclock.monitor.005.sh [deleted file]
ctdb/tests/eventscripts/scripts/01.reclock.sh

index e14d8c22f488576b300f7f22ce91f17241687cc2..2f4ed355e5e4212e1481f69edf0f95289c4146e5 100755 (executable)
@@ -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 (executable)
index c495a47..0000000
+++ /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 (executable)
index 7d0dcbf..0000000
+++ /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 (executable)
index 3e28ebb..0000000
+++ /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 (executable)
index 965f246..0000000
+++ /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 <<EOF
-ERROR: 4 consecutive failures checking reclock
-EOF
-simple_test
diff --git a/ctdb/tests/eventscripts/01.reclock.monitor.005.sh b/ctdb/tests/eventscripts/01.reclock.monitor.005.sh
deleted file mode 100755 (executable)
index 1590520..0000000
+++ /dev/null
@@ -1,28 +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
-for i in $(seq 1 3) ; do
-       simple_test
-done
-
-for i in $(seq 4 199) ; do
-       required_result 1 <<EOF
-ERROR: ${i} consecutive failures checking reclock
-EOF
-       simple_test
-done
-
-required_result 1 <<EOF
-Reclock file "${CTDB_RECOVERY_LOCK}" can not be accessed. Shutting down.
-Filesystem             1024-blocks      Used Available Capacity Mounted on
-/dev/sda1                               1000000     100000     900000         10% /
-CTDB says BYE!
-EOF
-simple_test
index 7916d7fc668b59528bcafe616d9a257a8d8719c5..25c845f667b997595530aa27ae1ca3378dfe0f77 100644 (file)
@@ -1,12 +1,3 @@
-cleanup_reclock ()
-{
-       _pattern="${script_dir}/${script}"
-       while pgrep -f "$_pattern" >/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
 }