[SCM] CTDB repository - branch master updated - 008533d971aec9c28c6e4750ef4677dd943633ff

Ronnie Sahlberg sahlberg at samba.org
Thu Jul 31 06:19:31 GMT 2008


The branch, master has been updated
       via  008533d971aec9c28c6e4750ef4677dd943633ff (commit)
       via  d3f5d75665a78ae0081fda57e58384b27a6ae396 (commit)
       via  22f737be0e70fc043affaa4f953f60d852b7999a (commit)
      from  ded1a974cdd86b436c6e5cba27069d1a3796dbe9 (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 008533d971aec9c28c6e4750ef4677dd943633ff
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jul 30 13:21:02 2008 +1000

    cleanup on SIGINT

commit d3f5d75665a78ae0081fda57e58384b27a6ae396
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jul 30 13:20:47 2008 +1000

    - cleanup persistent db at start
    - catch SIGINT and kill daemons

commit 22f737be0e70fc043affaa4f953f60d852b7999a
Author: Andrew Tridgell <tridge at samba.org>
Date:   Wed Jul 30 13:20:24 2008 +1000

    - show pids during test
    - don't use first_time, as it is not safe for multiple
      clients on a node

-----------------------------------------------------------------------

Summary of changes:
 tests/ctdb_persistent.c |   13 +++++--------
 tests/fetch.sh          |    2 ++
 tests/persistent.sh     |    8 +++++++-
 tests/run_tests.sh      |    2 ++
 4 files changed, 16 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/tests/ctdb_persistent.c b/tests/ctdb_persistent.c
index 7bd4ab8..c95ab93 100644
--- a/tests/ctdb_persistent.c
+++ b/tests/ctdb_persistent.c
@@ -57,7 +57,7 @@ static void each_second(struct event_context *ev, struct timed_event *te,
 	uint32_t *old_counters;
 
 
-	printf("Counters: ");
+	printf("[%4u] Counters: ", getpid());
 	old_counters = (uint32_t *)old_data.dptr;
 	for (i=0;i<old_data.dsize/sizeof(uint32_t); i++) {
 		printf("%6u ", old_counters[i]);
@@ -78,7 +78,8 @@ static void check_counters(struct ctdb_context *ctdb, TDB_DATA data)
 	/* check that all the counters are monotonic increasing */
 	for (i=0; i<old_data.dsize/sizeof(uint32_t); i++) {
 		if (counters[i]<old_counters[i]) {
-			printf("ERROR: counters has decreased for node %u  From %u to %u\n", i, old_counters[i], counters[i]);
+			printf("[%4u] ERROR: counters has decreased for node %u  From %u to %u\n", 
+			       getpid(), i, old_counters[i], counters[i]);
 			success = false;
 		}
 	}
@@ -101,7 +102,6 @@ static void test_store_records(struct ctdb_context *ctdb, struct event_context *
 	int ret;
 	struct ctdb_record_handle *h;
 	uint32_t *counters;
-	int first_time = true;	
 	ctdb_db = ctdb_db_handle(ctdb, "persistent.tdb");
 
 	key.dptr = discard_const("testkey");
@@ -135,11 +135,6 @@ static void test_store_records(struct ctdb_context *ctdb, struct event_context *
 
 		counters = (uint32_t *)data.dptr;
 
-		if (first_time) {
-			counters[pnn] = 0;
-			first_time = false;
-		}
-
 		/* bump our counter */
 		counters[pnn]++;
 
@@ -181,6 +176,8 @@ int main(int argc, const char *argv[])
 	poptContext pc;
 	struct event_context *ev;
 
+	setlinebuf(stdout);
+
 	pc = poptGetContext(argv[0], argc, argv, popt_options, POPT_CONTEXT_KEEP_FIRST);
 
 	while ((opt = poptGetNextOpt(pc)) != -1) {
diff --git a/tests/fetch.sh b/tests/fetch.sh
index f4c820a..a075321 100755
--- a/tests/fetch.sh
+++ b/tests/fetch.sh
@@ -5,6 +5,8 @@ if [ $# -gt 0 ]; then
     NUMNODES=$1
 fi
 
+trap 'echo "Killing test"; killall -9 -q ctdbd ctdb_fetch; exit 1' INT TERM
+
 tests/start_daemons.sh $NUMNODES || exit 1
 
 
diff --git a/tests/persistent.sh b/tests/persistent.sh
index 327f8bc..112e9fd 100755
--- a/tests/persistent.sh
+++ b/tests/persistent.sh
@@ -5,14 +5,19 @@ if [ $# -gt 0 ]; then
     NUMNODES=$1
 fi
 
+killall -9 -q ctdb_persistent ctdbd
+
+rm -rf test.db/persistent
 
 echo "Starting $NUMNODES daemons for SAFE persistent writes"
 tests/start_daemons.sh $NUMNODES || exit 1
 
-killall -9 -q ctdb_persistent
+trap 'echo "Killing test"; killall -9 -q ctdbd ctdb_persistent; exit 1' INT TERM
+
 
 for i in `seq 1 $NUMNODES`; do
   $VALGRIND bin/ctdb_persistent --timelimit 30 --socket sock.$i $* &
+  $VALGRIND bin/ctdb_persistent --timelimit 30 --socket sock.$i $* &
 done
 wait
 
@@ -29,6 +34,7 @@ killall -9 -q ctdb_persistent
 
 for i in `seq 1 $NUMNODES`; do
   $VALGRIND bin/ctdb_persistent --unsafe-writes --timelimit 30 --socket sock.$i $* &
+  $VALGRIND bin/ctdb_persistent --unsafe-writes --timelimit 30 --socket sock.$i $* &
 done
 wait
 
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 356a9b2..3e1caf4 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+trap 'echo "Killing test"; killall -9 -q ctdbd; exit 1' INT TERM
+
 tests/fetch.sh 4 || exit 1
 tests/bench.sh 4 || exit 1
 tests/ctdbd.sh || exit 1


-- 
CTDB repository


More information about the samba-cvs mailing list