mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
ctdb-tests: Improve code quality in ctdb_init()
Improve quoting and indentation. Print a clear error if the cluster goes back into recovery and doesn't come back out. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
3b5ed00054
commit
dd9d5ec5c8
@ -578,20 +578,22 @@ ctdb_init ()
|
||||
onnode -pq all "$CTDB setvar RerecoveryTimeout 1"
|
||||
|
||||
echo "Forcing a recovery..."
|
||||
onnode -q 0 $CTDB recover
|
||||
onnode -q 0 "$CTDB recover"
|
||||
sleep_for 2
|
||||
|
||||
if ! onnode -q any $CTDB_TEST_WRAPPER _cluster_is_recovered ; then
|
||||
echo "Cluster has gone into recovery again, waiting..."
|
||||
wait_until 30/2 onnode -q any $CTDB_TEST_WRAPPER _cluster_is_recovered
|
||||
if ! onnode -q all "$CTDB_TEST_WRAPPER _cluster_is_recovered" ; then
|
||||
echo "Cluster has gone into recovery again, waiting..."
|
||||
wait_until 30/2 onnode -q all \
|
||||
"$CTDB_TEST_WRAPPER _cluster_is_recovered" || \
|
||||
ctdb_test_error "Cluster did not come out of recovery"
|
||||
fi
|
||||
|
||||
if ! onnode 0 $CTDB_TEST_WRAPPER _cluster_is_healthy ; then
|
||||
ctdb_test_error "Cluster became UNHEALTHY again [$(date)]"
|
||||
if ! onnode 0 "$CTDB_TEST_WRAPPER _cluster_is_healthy" ; then
|
||||
ctdb_test_error "Cluster became UNHEALTHY again [$(date)]"
|
||||
fi
|
||||
|
||||
echo "Doing a sync..."
|
||||
onnode -q 0 $CTDB sync
|
||||
onnode -q 0 "$CTDB sync"
|
||||
|
||||
echo "ctdb is ready"
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user