]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
recover.sh test script that build a few database and populates them with
authorRonnie Sahlberg <sahlberg@ronnie>
Wed, 2 May 2007 11:14:37 +0000 (21:14 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Wed, 2 May 2007 11:14:37 +0000 (21:14 +1000)
a record  then performs a recovery which merges all records onto node 0

(This used to be ctdb commit 54a072deb40d8d4a4a9e35bfde0eec3c867211d0)

ctdb/tests/recover.sh

index d9923d81394d2dda9553bf72799675051329ed2d..cd72440fbedcc38913d25988c399d1b2e53f916b 100755 (executable)
@@ -37,6 +37,55 @@ done
 echo
 echo
 echo "Populating the databases"
+./bin/ctdb_control --socket=/tmp/ctdb.socket writerecord 0 0x220c2a7b testkey1 testdata1
+./bin/ctdb_control --socket=/tmp/ctdb.socket setdmaster 0 0x220c2a7b 1
+
+./bin/ctdb_control --socket=/tmp/ctdb.socket writerecord 1 0x220c2a7b testkey1 testdata1
+./bin/ctdb_control --socket=/tmp/ctdb.socket writerecord 1 0x220c2a7b testkey1 testdata1
+./bin/ctdb_control --socket=/tmp/ctdb.socket setdmaster 1 0x220c2a7b 2
+
+./bin/ctdb_control --socket=/tmp/ctdb.socket writerecord 2 0x220c2a7b testkey1 testdata1
+./bin/ctdb_control --socket=/tmp/ctdb.socket writerecord 2 0x220c2a7b testkey1 testdata1
+./bin/ctdb_control --socket=/tmp/ctdb.socket writerecord 2 0x220c2a7b testkey1 testdata1
+./bin/ctdb_control --socket=/tmp/ctdb.socket setdmaster 2 0x220c2a7b 3
+
+./bin/ctdb_control --socket=/tmp/ctdb.socket writerecord 3 0x220c2a7b testkey1 testdata1
+./bin/ctdb_control --socket=/tmp/ctdb.socket writerecord 3 0x220c2a7b testkey1 testdata1
+./bin/ctdb_control --socket=/tmp/ctdb.socket writerecord 3 0x220c2a7b testkey1 testdata1
+./bin/ctdb_control --socket=/tmp/ctdb.socket writerecord 3 0x220c2a7b testkey1 testdata1
+./bin/ctdb_control --socket=/tmp/ctdb.socket setdmaster 3 0x220c2a7b 3
+
+
+echo
+echo
+echo "Printing all databases on all nodes. there should be a record there"
+echo "============================================================="
+bin/ctdb_control --socket=/tmp/ctdb.socket getdbmap 0 | egrep "^dbid:" | sed -e "s/^dbid://" -e "s/ .*$//" | while read DB; do
+       seq 0 3 | while read NODE; do
+               echo "Content of DB:$DB NODE:$NODE :"
+               bin/ctdb_control --socket=/tmp/ctdb.socket catdb $NODE $DB
+       done
+done
+
+echo
+echo
+echo "Recovery the cluster"
+echo "===================="
+./bin/ctdb_control --socket=/tmp/ctdb.socket recover 0 0x220c2a7b
+
+echo
+echo
+echo "Printing all databases on all nodes."
+echo "The databases should be the same now on all nodes"
+echo "and the record will have been migrated to node 0"
+echo "================================================="
+bin/ctdb_control --socket=/tmp/ctdb.socket getdbmap 0 | egrep "^dbid:" | sed -e "s/^dbid://" -e "s/ .*$//" | while read DB; do
+       seq 0 3 | while read NODE; do
+               echo "Content of DB:$DB NODE:$NODE :"
+               bin/ctdb_control --socket=/tmp/ctdb.socket catdb $NODE $DB
+       done
+done
+
 
 #leave the ctdb daemons running
 #killall -q ctdbd