From: Ronnie Sahlberg Date: Wed, 2 May 2007 11:14:37 +0000 (+1000) Subject: recover.sh test script that build a few database and populates them with X-Git-Tag: tevent-0.9.20~348^2~2794^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97504b62e2f2f55ccb0d24c7903e51bcce423ea4;p=thirdparty%2Fsamba.git recover.sh test script that build a few database and populates them with a record then performs a recovery which merges all records onto node 0 (This used to be ctdb commit 54a072deb40d8d4a4a9e35bfde0eec3c867211d0) --- diff --git a/ctdb/tests/recover.sh b/ctdb/tests/recover.sh index d9923d81394..cd72440fbed 100755 --- a/ctdb/tests/recover.sh +++ b/ctdb/tests/recover.sh @@ -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