*/
#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;
/*
#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
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
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};
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;
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();
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;
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:
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"
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;
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);
echo "All done"
killall -q ctdbd
+exit 0
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