mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
ctdb-daemon: Mark RecoverPDBBySeqNum tunable deprecated
Persistent databases are now always recovered by sequence number, so there is no need for this tunable. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Fri Nov 25 08:13:59 CET 2016 on sn-devel-144
This commit is contained in:
parent
2a9584dc0a
commit
f2414841f2
@ -119,7 +119,7 @@ static struct {
|
|||||||
offsetof(struct ctdb_tunable_list, deferred_attach_timeout) },
|
offsetof(struct ctdb_tunable_list, deferred_attach_timeout) },
|
||||||
{ "AllowClientDBAttach", 1, false,
|
{ "AllowClientDBAttach", 1, false,
|
||||||
offsetof(struct ctdb_tunable_list, allow_client_db_attach) },
|
offsetof(struct ctdb_tunable_list, allow_client_db_attach) },
|
||||||
{ "RecoverPDBBySeqNum", 1, false,
|
{ "RecoverPDBBySeqNum", 1, true,
|
||||||
offsetof(struct ctdb_tunable_list, recover_pdb_by_seqnum) },
|
offsetof(struct ctdb_tunable_list, recover_pdb_by_seqnum) },
|
||||||
{ "DeferredRebalanceOnNodeAdd", 300, true,
|
{ "DeferredRebalanceOnNodeAdd", 300, true,
|
||||||
offsetof(struct ctdb_tunable_list, deferred_rebalance_on_node_add) },
|
offsetof(struct ctdb_tunable_list, deferred_rebalance_on_node_add) },
|
||||||
|
@ -461,27 +461,6 @@
|
|||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<refsect2>
|
|
||||||
<title>RecoverPDBBySeqNum</title>
|
|
||||||
<para>Default: 1</para>
|
|
||||||
<para>
|
|
||||||
When set to zero, database recovery for persistent databases is
|
|
||||||
record-by-record and recovery process simply collects the most
|
|
||||||
recent version of every individual record.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
When set to non-zero, persistent databases will instead be
|
|
||||||
recovered as a whole db and not by individual records. The
|
|
||||||
node that contains the highest value stored in the record
|
|
||||||
"__db_sequence_number__" is selected and the copy of that nodes
|
|
||||||
database is used as the recovered database.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
By default, recovery of persistent databses is done using
|
|
||||||
__db_sequence_number__ record.
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<refsect2>
|
<refsect2>
|
||||||
<title>RecoverTimeout</title>
|
<title>RecoverTimeout</title>
|
||||||
<para>Default: 120</para>
|
<para>Default: 120</para>
|
||||||
|
@ -1705,7 +1705,7 @@ static void recover_db_transaction_started(struct tevent_req *subreq)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state->persistent && state->tun_list->recover_pdb_by_seqnum != 0) {
|
if (state->persistent) {
|
||||||
subreq = collect_highseqnum_db_send(
|
subreq = collect_highseqnum_db_send(
|
||||||
state, state->ev, state->client,
|
state, state->ev, state->client,
|
||||||
state->pnn_list, state->count, state->caps,
|
state->pnn_list, state->count, state->caps,
|
||||||
@ -1734,7 +1734,7 @@ static void recover_db_collect_done(struct tevent_req *subreq)
|
|||||||
int ret;
|
int ret;
|
||||||
bool status;
|
bool status;
|
||||||
|
|
||||||
if (state->persistent && state->tun_list->recover_pdb_by_seqnum != 0) {
|
if (state->persistent) {
|
||||||
status = collect_highseqnum_db_recv(subreq, &ret);
|
status = collect_highseqnum_db_recv(subreq, &ret);
|
||||||
} else {
|
} else {
|
||||||
status = collect_all_db_recv(subreq, &ret);
|
status = collect_all_db_recv(subreq, &ret);
|
||||||
|
@ -3,16 +3,10 @@
|
|||||||
test_info()
|
test_info()
|
||||||
{
|
{
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
The tunable RecoverPDBBySeqNum controls how we perform recovery
|
The persistent databases are recovered using sequence number.
|
||||||
on persistent databases.
|
The recovery is performed by picking the copy of the database from the
|
||||||
The default is that persistent databases are recovered exactly the same
|
node that has the highest sequence number and ignore the content on all
|
||||||
way as normal databases. That is that we recover record by record.
|
other nodes.
|
||||||
|
|
||||||
If RecoverPDBBySeqNum is set to 1 AND if a record with the key
|
|
||||||
"__db_sequence_number__" can be found in the database, then instead we will
|
|
||||||
perform the recovery by picking the copy of the database from the node
|
|
||||||
that has the highest sequence number and ignore the content on all other
|
|
||||||
nodes.
|
|
||||||
|
|
||||||
|
|
||||||
Prerequisites:
|
Prerequisites:
|
||||||
@ -23,19 +17,12 @@ Steps:
|
|||||||
|
|
||||||
1. Verify that the status on all of the ctdb nodes is 'OK'.
|
1. Verify that the status on all of the ctdb nodes is 'OK'.
|
||||||
2. create a persistent test database
|
2. create a persistent test database
|
||||||
3. test that RecoveryPDBBySeqNum==0 and no seqnum record blends the database
|
3. test that no seqnum record blends the database during recovery
|
||||||
during recovery
|
4. test that seqnum record does not blend the database during recovery
|
||||||
4. test that RecoveryPDBBySeqNum==0 and seqnum record blends the database
|
|
||||||
during recovery
|
|
||||||
5. test that RecoveryPDBBySeqNum==1 and no seqnum record blends the database
|
|
||||||
during recovery
|
|
||||||
6. test that RecoveryPDBBySeqNum==1 and seqnum record does not blend the database
|
|
||||||
during recovery
|
|
||||||
|
|
||||||
Expected results:
|
Expected results:
|
||||||
|
|
||||||
* that 3,4,5 will blend the databases and that 6 will recovery the highest seqnum
|
* that 3,4 will recover the highest seqnum database
|
||||||
database
|
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@ -70,90 +57,14 @@ test_db="persistent_test.tdb"
|
|||||||
echo "Create persistent test database \"$test_db\""
|
echo "Create persistent test database \"$test_db\""
|
||||||
try_command_on_node 0 $CTDB attach "$test_db" persistent
|
try_command_on_node 0 $CTDB attach "$test_db" persistent
|
||||||
|
|
||||||
|
# 3,
|
||||||
echo "Setting RecoverPDBBySeqNum=0"
|
# If no __db_sequence_number__ recover whole database
|
||||||
try_command_on_node all $CTDB setvar "RecoverPDBBySeqNum" 0
|
|
||||||
|
|
||||||
# 3.
|
|
||||||
# If RecoverPDBBySeqNum==0 and no __db_sequence_number__
|
|
||||||
# recover record by record
|
|
||||||
#
|
#
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Test that no __db_sequence_number__ does not blend the database during recovery"
|
||||||
|
|
||||||
# wipe database
|
# wipe database
|
||||||
echo
|
|
||||||
echo "Test that RecoverPDBBySeqNum=0 and no __db_sequence_number__ blends the database during recovery"
|
|
||||||
|
|
||||||
echo "Wipe test database"
|
|
||||||
try_command_on_node 0 $CTDB wipedb "$test_db"
|
|
||||||
|
|
||||||
add_record_per_node
|
|
||||||
|
|
||||||
# force a recovery
|
|
||||||
echo "Force a recovery"
|
|
||||||
try_command_on_node 0 $CTDB recover
|
|
||||||
|
|
||||||
# check that we now have both records on node 0
|
|
||||||
num_records=$(db_ctdb_cattdb_count_records 0 "$test_db")
|
|
||||||
if [ $num_records = "$num_nodes" ] ; then
|
|
||||||
echo "OK: databases were blended"
|
|
||||||
else
|
|
||||||
echo "BAD: we did not end up with the expected $num_nodes records after the recovery"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 4.
|
|
||||||
# If RecoverPDBBySeqNum==0 and __db_sequence_number__
|
|
||||||
# recover record by record
|
|
||||||
#
|
|
||||||
# wipe database
|
|
||||||
echo
|
|
||||||
echo "Test that RecoverPDBBySeqNum=0 and __db_sequence_number__ blends the database during recovery"
|
|
||||||
|
|
||||||
echo "Wipe the test database"
|
|
||||||
try_command_on_node 0 $CTDB wipedb persistent_test.tdb
|
|
||||||
|
|
||||||
add_record_per_node
|
|
||||||
|
|
||||||
echo "Add __db_sequence_number__==5 record to all nodes"
|
|
||||||
pnn=0
|
|
||||||
while [ $pnn -lt $num_nodes ] ; do
|
|
||||||
db_ctdb_tstore_dbseqnum $pnn "$test_db" 5
|
|
||||||
pnn=$(($pnn + 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Set __db_sequence_number__ to 7 on node 0"
|
|
||||||
db_ctdb_tstore_dbseqnum 0 "$test_db" 7
|
|
||||||
|
|
||||||
echo "Set __db_sequence_number__ to 8 on node 1"
|
|
||||||
db_ctdb_tstore_dbseqnum 1 "$test_db" 8
|
|
||||||
|
|
||||||
# force a recovery
|
|
||||||
echo "Force a recovery"
|
|
||||||
try_command_on_node 0 $CTDB recover
|
|
||||||
|
|
||||||
# check that we now have both records on node 0
|
|
||||||
num_records=$(db_ctdb_cattdb_count_records 0 "$test_db")
|
|
||||||
if [ $num_records = "$num_nodes" ] ; then
|
|
||||||
echo "OK: databases were blended"
|
|
||||||
else
|
|
||||||
echo "BAD: we did not end up with the expected $num_nodes records after the recovery"
|
|
||||||
try_command_on_node -v 0 $CTDB cattdb "$test_db"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# set RecoverPDBBySeqNum=1
|
|
||||||
echo
|
|
||||||
echo "Setting RecoverPDBBySeqNum to 1"
|
|
||||||
try_command_on_node all $CTDB setvar "RecoverPDBBySeqNum" 1
|
|
||||||
|
|
||||||
|
|
||||||
# 5,
|
|
||||||
# If RecoverPDBBySeqNum==1 and no __db_sequence_number__
|
|
||||||
# recover whole database
|
|
||||||
#
|
|
||||||
# wipe database
|
|
||||||
echo
|
|
||||||
echo "Test that RecoverPDBBySeqNum=1 and no __db_sequence_number__ does not blend the database during recovery"
|
|
||||||
echo "Wipe the test database"
|
echo "Wipe the test database"
|
||||||
try_command_on_node 0 $CTDB wipedb "$test_db"
|
try_command_on_node 0 $CTDB wipedb "$test_db"
|
||||||
|
|
||||||
@ -173,14 +84,14 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# 4,
|
||||||
# 6,
|
# If __db_sequence_number__ recover whole database
|
||||||
# If RecoverPDBBySeqNum==1 and __db_sequence_number__
|
|
||||||
# recover whole database
|
|
||||||
#
|
#
|
||||||
# wipe database
|
|
||||||
echo
|
echo
|
||||||
echo test that RecoverPDBBySeqNum==1 and __db_sequence_number__ does not blend the database during recovery
|
echo test that __db_sequence_number__ does not blend the database during recovery
|
||||||
|
|
||||||
|
# wipe database
|
||||||
echo wipe the test database
|
echo wipe the test database
|
||||||
try_command_on_node 0 $CTDB wipedb persistent_test.tdb
|
try_command_on_node 0 $CTDB wipedb persistent_test.tdb
|
||||||
|
|
||||||
|
@ -3,11 +3,7 @@
|
|||||||
test_info()
|
test_info()
|
||||||
{
|
{
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
The recovery process based on RSN for persistent databases is defective.
|
This test confirms that the deleted records are not resurrected after recovery.
|
||||||
For persistent databases sequence number based recovery method should be
|
|
||||||
used. This test checks for the defect in the RSN based recovery method
|
|
||||||
for persistent databases and confirms that the same issue is not observed
|
|
||||||
when using sequence number based recovery method.
|
|
||||||
|
|
||||||
Steps:
|
Steps:
|
||||||
|
|
||||||
@ -20,8 +16,7 @@ Steps:
|
|||||||
|
|
||||||
Expected results:
|
Expected results:
|
||||||
|
|
||||||
* Check that the record is deleted (RSN based recovery) and record is
|
* Check that the deleted record is present after recovery.
|
||||||
present (sequence number based recovery)
|
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@ -83,21 +78,6 @@ status=0
|
|||||||
echo "create persistent test database $TESTDB"
|
echo "create persistent test database $TESTDB"
|
||||||
try_command_on_node 0 $CTDB attach $TESTDB persistent
|
try_command_on_node 0 $CTDB attach $TESTDB persistent
|
||||||
|
|
||||||
echo "set RecoverPDBBySeqNum to 0"
|
|
||||||
try_command_on_node all $CTDB setvar RecoverPDBBySeqNum 0
|
|
||||||
|
|
||||||
do_test
|
|
||||||
if try_command_on_node 0 $CTDB pfetch $TESTDB test1 ; then
|
|
||||||
echo "GOOD: Record was not deleted (recovery by RSN worked)"
|
|
||||||
else
|
|
||||||
echo "BAD: Record was deleted"
|
|
||||||
status=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set RecoverPDBBySeqNum = 1
|
|
||||||
echo "set RecoverPDBBySeqNum to 1"
|
|
||||||
try_command_on_node all $CTDB setvar RecoverPDBBySeqNum 1
|
|
||||||
|
|
||||||
do_test
|
do_test
|
||||||
if try_command_on_node 0 $CTDB pfetch $TESTDB test1 ; then
|
if try_command_on_node 0 $CTDB pfetch $TESTDB test1 ; then
|
||||||
echo "GOOD: Record was not deleted (recovery by sequence number worked)"
|
echo "GOOD: Record was not deleted (recovery by sequence number worked)"
|
||||||
|
@ -51,7 +51,6 @@ AllowUnhealthyDBRead = 0
|
|||||||
StatHistoryInterval = 1
|
StatHistoryInterval = 1
|
||||||
DeferredAttachTO = 120
|
DeferredAttachTO = 120
|
||||||
AllowClientDBAttach = 1
|
AllowClientDBAttach = 1
|
||||||
RecoverPDBBySeqNum = 1
|
|
||||||
FetchCollapse = 1
|
FetchCollapse = 1
|
||||||
HopcountMakeSticky = 50
|
HopcountMakeSticky = 50
|
||||||
StickyDuration = 600
|
StickyDuration = 600
|
||||||
|
Loading…
Reference in New Issue
Block a user