Rev 432: make test now works again in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Sat Jun 2 03:31:37 GMT 2007


------------------------------------------------------------
revno: 432
revision-id: tridge at samba.org-20070602033136-ojzzrsknaseuwiyq
parent: tridge at samba.org-20070602031611-a21igkxq7tbng2u7
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Sat 2007-06-02 13:31:36 +1000
message:
  make test now works again
modified:
  include/ctdb.h                 ctdb.h-20061117234101-o3qt14umlg9en8z0-11
  include/ctdb_private.h         ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  tests/bench.sh                 bench.sh-20070209014602-vdolpr6esqsa58s7-1
  tests/ctdb_bench.c             ctdb_bench.c-20061219052637-2liagoglohxb6p7s-1
  tests/ctdb_fetch.c             ctdb_fetch.c-20070405031748-f7gslozfj3rwh5ie-1
  tests/ctdbd.sh                 ctdbd.sh-20070411085038-phusiewluwzyqjpc-2
  tests/fetch.sh                 fetch.sh-20070405031756-lomzqpjyqg3xd1kv-1
=== modified file 'include/ctdb.h'
--- a/include/ctdb.h	2007-05-31 03:50:53 +0000
+++ b/include/ctdb.h	2007-06-02 03:31:36 +0000
@@ -72,6 +72,14 @@
  */
 #define CTDB_SRVID_RELEASE_IP 0xF300000000000000LL
 
+/* used on the domain socket, send a pdu to the local daemon */
+#define CTDB_CURRENT_NODE     0xF0000001
+/* send a broadcast to all nodes in the cluster, active or not */
+#define CTDB_BROADCAST_ALL    0xF0000002
+/* send a broadcast to all nodes in the current vnn map */
+#define CTDB_BROADCAST_VNNMAP 0xF0000003
+
+
 struct event_context;
 
 /*

=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h	2007-06-02 01:36:42 +0000
+++ b/include/ctdb_private.h	2007-06-02 03:31:36 +0000
@@ -38,13 +38,6 @@
 #define CTDB_NULL_FUNC      0xFF000001
 #define CTDB_FETCH_FUNC     0xFF000002
 
-/* used on the domain socket, send a pdu to the local daemon */
-#define CTDB_CURRENT_NODE     0xF0000001
-/* send a broadcast to all nodes in the cluster, active or not */
-#define CTDB_BROADCAST_ALL    0xF0000002
-/* send a broadcast to all nodes in the current vnn map */
-#define CTDB_BROADCAST_VNNMAP 0xF0000003
-
 #define CTDB_MAX_REDIRECT_COUNT 3
 #define CTDB_DEFAULT_SEQNUM_FREQUENCY 1
 

=== modified file 'tests/bench.sh'
--- a/tests/bench.sh	2007-06-02 03:16:11 +0000
+++ b/tests/bench.sh	2007-06-02 03:31:36 +0000
@@ -20,8 +20,8 @@
 killall -9 ctdb_bench
 echo "Trying $NUMNODES nodes"
 for i in `seq 1 $NUMNODES`; do
-  $VALGRIND bin/ctdb_bench --nlist nodes.txt --socket sock.$i $* &
+  valgrind -q $VALGRIND bin/ctdb_bench --socket sock.$i -n $NUMNODES $*  &
 done
 
 wait
-ctdb shutdown --socket sock.1 -n all
+bin/ctdb shutdown --socket sock.1 -n all

=== modified file 'tests/ctdb_bench.c'
--- a/tests/ctdb_bench.c	2007-06-02 03:16:11 +0000
+++ b/tests/ctdb_bench.c	2007-06-02 03:31:36 +0000
@@ -44,8 +44,7 @@
 
 static int timelimit = 10;
 static int num_records = 10;
-static int num_msgs = 1;
-static uint32_t num_nodes;
+static int num_nodes;
 
 enum my_functions {FUNC_INCR=1, FUNC_FETCH=2};
 
@@ -109,7 +108,6 @@
 	int vnn=ctdb_get_vnn(ctdb);
 
 	if (vnn == 0) {
-		int i;
 		/* two messages are injected into the ring, moving
 		   in opposite directions */
 		int dest, incr;
@@ -118,15 +116,13 @@
 		data.dptr = (uint8_t *)&incr;
 		data.dsize = sizeof(incr);
 
-		for (i=0;i<num_msgs;i++) {
-			incr = 1;
-			dest = (ctdb_get_vnn(ctdb) + incr) % num_nodes;
-			ctdb_send_message(ctdb, dest, 0, data);
-
-			incr = -1;
-			dest = (ctdb_get_vnn(ctdb) + incr) % num_nodes;
-			ctdb_send_message(ctdb, dest, 0, data);
-		}
+		incr = 1;
+		dest = (ctdb_get_vnn(ctdb) + incr) % num_nodes;
+		ctdb_send_message(ctdb, dest, 0, data);
+		
+		incr = -1;
+		dest = (ctdb_get_vnn(ctdb) + incr) % num_nodes;
+		ctdb_send_message(ctdb, dest, 0, data);
 	}
 	
 	start_timer();
@@ -168,7 +164,7 @@
 		POPT_CTDB_CMDLINE
 		{ "timelimit", 't', POPT_ARG_INT, &timelimit, 0, "timelimit", "integer" },
 		{ "num-records", 'r', POPT_ARG_INT, &num_records, 0, "num_records", "integer" },
-		{ "num-msgs", 'n', POPT_ARG_INT, &num_msgs, 0, "num_msgs", "integer" },
+		{ NULL, 'n', POPT_ARG_INT, &num_nodes, 0, "num_nodes", "integer" },
 		POPT_TABLEEND
 	};
 	int opt;
@@ -220,12 +216,13 @@
 		goto error;
 
 	printf("Waiting for cluster\n");
-	while (!cluster_ready) {
+	while (1) {
+		uint32_t recmode=1;
+		ctdb_ctrl_getrecmode(ctdb, timeval_zero(), CTDB_CURRENT_NODE, &recmode);
+		if (recmode == 0) break;
 		event_loop_once(ev);
 	}
 
-	ctdb_get_connected_nodes(ctdb, timeval_zero(), ctdb, &num_nodes);
-
 	bench_ring(ctdb, ev);
        
 error:

=== modified file 'tests/ctdb_fetch.c'
--- a/tests/ctdb_fetch.c	2007-06-02 03:16:11 +0000
+++ b/tests/ctdb_fetch.c	2007-06-02 03:31:36 +0000
@@ -44,8 +44,7 @@
 
 static int timelimit = 10;
 static int num_records = 10;
-static int num_msgs = 1;
-static uint32_t num_nodes;
+static int num_nodes;
 static int msg_count;
 
 #define TESTKEY "testkey"
@@ -181,7 +180,7 @@
 		POPT_CTDB_CMDLINE
 		{ "timelimit", 't', POPT_ARG_INT, &timelimit, 0, "timelimit", "integer" },
 		{ "num-records", 'r', POPT_ARG_INT, &num_records, 0, "num_records", "integer" },
-		{ "num-msgs", 'n', POPT_ARG_INT, &num_msgs, 0, "num_msgs", "integer" },
+		{ NULL, 'n', POPT_ARG_INT, &num_nodes, 0, "num_nodes", "integer" },
 		POPT_TABLEEND
 	};
 	int opt;
@@ -232,12 +231,13 @@
 	ctdb_set_message_handler(ctdb, 0, message_handler, &msg_count);
 
 	printf("Waiting for cluster\n");
-	while (!cluster_ready) {
+	while (1) {
+		uint32_t recmode=1;
+		ctdb_ctrl_getrecmode(ctdb, timeval_zero(), CTDB_CURRENT_NODE, &recmode);
+		if (recmode == 0) break;
 		event_loop_once(ev);
 	}
 
-	ctdb_get_connected_nodes(ctdb, timeval_zero(), ctdb, &num_nodes);
-
 	bench_fetch(ctdb, ev);
 
 	ZERO_STRUCT(call);

=== modified file 'tests/ctdbd.sh'
--- a/tests/ctdbd.sh	2007-06-02 01:36:42 +0000
+++ b/tests/ctdbd.sh	2007-06-02 03:31:36 +0000
@@ -48,3 +48,4 @@
 
 echo "All done"
 killall -q ctdbd
+exit 0

=== modified file 'tests/fetch.sh'
--- a/tests/fetch.sh	2007-06-02 03:16:11 +0000
+++ b/tests/fetch.sh	2007-06-02 03:31:36 +0000
@@ -18,9 +18,10 @@
 
 killall -9 -q ctdb_fetch
 for i in `seq 1 $NUMNODES`; do
-  $VALGRIND bin/ctdb_fetch --socket sock.$i $* &
+  $VALGRIND bin/ctdb_fetch --socket sock.$i -n $NUMNODES $* &
 done
 wait
 
 echo "Shutting down"
 bin/ctdb shutdown -n all --socket=sock.1
+exit 0



More information about the samba-cvs mailing list