This makes the logic more obvious.
Fix the (probably) accidental fall-through to the regular monitor
failure.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
) >/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
simple_test
required_result 1 <<EOF
-ERROR: 4 consecutive failures for 01.reclock, marking node unhealthy
+ERROR: 4 consecutive failures checking reclock
EOF
simple_test
for i in $(seq 4 199) ; do
required_result 1 <<EOF
-ERROR: ${i} consecutive failures for 01.reclock, marking node unhealthy
+ERROR: ${i} consecutive failures checking reclock
EOF
simple_test
done
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/sda1 1000000 100000 900000 10% /
CTDB says BYE!
-ERROR: 200 consecutive failures for 01.reclock, marking node unhealthy
EOF
simple_test