1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

ctdb-tests/simple: Update persistent DB tests

* Low level DB checks should ignore the sequence number record.

* A restart is needed after messing with the RecoverPDBBySeqNum
  tunable.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Martin Schwenke 2013-11-15 15:21:58 +11:00 committed by Michael Adam
parent efc77ba6ac
commit 2b6db9041d
3 changed files with 13 additions and 13 deletions

View File

@ -48,6 +48,9 @@ set -e
cluster_is_healthy
# Reset configuration
ctdb_restart_when_done
try_command_on_node 0 "$CTDB listnodes"
num_nodes=$(echo "$out" | wc -l)
@ -149,11 +152,11 @@ try_command_on_node all $CTDB setvar RecoverPDBBySeqNum 1
# 5,
# If RecoverPDBBySeqNum==1 and no __db_sequence_number__
# recover record by record
# recover whole database
#
# wipe database
echo
echo test that RecoverPDBBySeqNum==1 and no __db_sequence_number__ blends the database during recovery
echo test that RecoverPDBBySeqNum==1 and no __db_sequence_number__ does not blend the database during recovery
echo wipe the test database
try_command_on_node 0 $CTDB wipedb persistent_test.tdb
@ -173,11 +176,11 @@ try_command_on_node 0 $CTDB recover
# check that we now have both records on node 0
num_records=$(try_command_on_node -v 0 $CTDB cattdb persistent_test.tdb | grep key | egrep "ABC|DEF" | wc -l)
[ $num_records != "2" ] && {
echo "BAD: we did not end up with the expected two records after the recovery"
[ $num_records != "1" ] && {
echo "BAD: we did not end up with the expected single record after the recovery"
exit 1
}
echo "OK. databases were blended"
echo "OK. databases were not blended"
@ -224,9 +227,3 @@ num_records=$(try_command_on_node -v 0 $CTDB cattdb persistent_test.tdb | grep k
}
echo "OK. databases were not blended"
# set RecoverPDBBySeqNum=1
echo "setting RecoverPDBBySeqNum back to 0"
try_command_on_node all $CTDB setvar RecoverPDBBySeqNum 0

View File

@ -55,11 +55,13 @@ try_command_on_node 1 $CTDB tstore $TDB 0x444546 0x07000000000000000000000000000
# 4,
echo wipe the persistent test database
try_command_on_node 0 $CTDB wipedb persistent_test.tdb
echo force a recovery
try_command_on_node 0 $CTDB recover
# check that the database is wiped
num_records=$(try_command_on_node -v 1 $CTDB cattdb persistent_test.tdb | grep key | wc -l)
num_records=$(try_command_on_node -v 1 $CTDB cattdb persistent_test.tdb | \
grep key | grep -v '__db_sequence_number__' | wc -l)
[ $num_records != "0" ] && {
echo "BAD: we did not end up with an empty database"
exit 1

View File

@ -51,7 +51,8 @@ echo force a recovery
try_command_on_node 0 $CTDB recover
# check that the database is wiped
num_records=$(try_command_on_node -v 1 $CTDB cattdb $TDB | grep key | wc -l)
num_records=$(try_command_on_node -v 1 $CTDB cattdb $TDB | \
grep key | grep -v '__db_sequence_number__' | wc -l)
[ $num_records != "0" ] && {
echo "BAD: we did not end up with an empty database"
exit 1