6 This test confirms that the deleted records are not resurrected after recovery.
10 1. Create a persistent database
11 2. Add a record and update it few times.
13 4. Turn off one of the nodes
14 5. Add a record with same key.
15 6. Turn on the stopped node
19 * Check that the deleted record is present after recovery.
24 . "${TEST_SCRIPTS_DIR}/integration.bash"
33 ctdb_restart_when_done
38 echo "wipe test database"
39 try_command_on_node 0 $CTDB wipedb $TESTDB
41 # Add a record key=test1 data=value1
43 for value in value1 value2 value3 value4 value5 ; do
44 echo "store key(test1) data($value)"
45 echo "\"test1\" \"$value\"" | try_command_on_node -i 0 $CTDB ptrans "$TESTDB"
49 echo "delete key(test1)"
50 try_command_on_node 0 $CTDB pdelete $TESTDB test1
54 try_command_on_node 1 $CTDB stop
56 wait_until_node_has_status 1 stopped
58 # Add a record key=test1 data=value2
59 echo "store key(test1) data(newvalue1)"
60 echo '"test1" "newvalue1"' | try_command_on_node -i 0 $CTDB ptrans "$TESTDB"
64 try_command_on_node 1 $CTDB continue
66 wait_until_node_has_status 1 notstopped
73 TESTDB="persistent_test.tdb"
77 # Create a temporary persistent database to test with
78 echo "create persistent test database $TESTDB"
79 try_command_on_node 0 $CTDB attach $TESTDB persistent
82 if try_command_on_node 0 $CTDB pfetch $TESTDB test1 ; then
83 echo "GOOD: Record was not deleted (recovery by sequence number worked)"
85 echo "BAD: Record was deleted"