summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctdb/common/ctdb.c1
-rw-r--r--ctdb/common/ctdb_traverse.c19
-rw-r--r--ctdb/tools/ctdb_control.c1
3 files changed, 15 insertions, 6 deletions
diff --git a/ctdb/common/ctdb.c b/ctdb/common/ctdb.c
index 91b0bfe3b54..10ae107e7c4 100644
--- a/ctdb/common/ctdb.c
+++ b/ctdb/common/ctdb.c
@@ -437,6 +437,7 @@ static void queue_next_trigger(struct event_context *ev, struct timed_event *te,
{
struct queue_next *q = talloc_get_type(private_data, struct queue_next);
ctdb_input_pkt(q->ctdb, q->hdr);
+ talloc_free(q);
}
/*
diff --git a/ctdb/common/ctdb_traverse.c b/ctdb/common/ctdb_traverse.c
index 53504215a4d..a89ddc3eb95 100644
--- a/ctdb/common/ctdb_traverse.c
+++ b/ctdb/common/ctdb_traverse.c
@@ -277,6 +277,7 @@ static void traverse_all_callback(void *p, TDB_DATA key, TDB_DATA data)
struct traverse_all_state *state = talloc_get_type(p, struct traverse_all_state);
int ret;
struct ctdb_rec_data *d;
+ TDB_DATA cdata;
d = ctdb_marshall_record(state, state->reqid, key, data);
if (d == NULL) {
@@ -285,14 +286,19 @@ static void traverse_all_callback(void *p, TDB_DATA key, TDB_DATA data)
return;
}
- data.dptr = (uint8_t *)d;
- data.dsize = d->length;
+ cdata.dptr = (uint8_t *)d;
+ cdata.dsize = d->length;
ret = ctdb_daemon_send_control(state->ctdb, state->srcnode, 0, CTDB_CONTROL_TRAVERSE_DATA,
- 0, CTDB_CTRL_FLAG_NOREPLY, data, NULL, NULL);
+ 0, CTDB_CTRL_FLAG_NOREPLY, cdata, NULL, NULL);
if (ret != 0) {
DEBUG(0,("Failed to send traverse data\n"));
}
+
+ if (key.dsize == 0 && data.dsize == 0) {
+ /* we're done */
+ talloc_free(state);
+ }
}
/*
@@ -397,6 +403,7 @@ static void traverse_start_callback(void *p, TDB_DATA key, TDB_DATA data)
{
struct traverse_start_state *state;
struct ctdb_rec_data *d;
+ TDB_DATA cdata;
state = talloc_get_type(p, struct traverse_start_state);
@@ -405,10 +412,10 @@ static void traverse_start_callback(void *p, TDB_DATA key, TDB_DATA data)
return;
}
- data.dptr = (uint8_t *)d;
- data.dsize = d->length;
+ cdata.dptr = (uint8_t *)d;
+ cdata.dsize = d->length;
- ctdb_dispatch_message(state->ctdb, state->srvid, data);
+ ctdb_dispatch_message(state->ctdb, state->srvid, cdata);
if (key.dsize == 0 && data.dsize == 0) {
/* end of traverse */
talloc_free(state);
diff --git a/ctdb/tools/ctdb_control.c b/ctdb/tools/ctdb_control.c
index 992991c2324..fd564fda701 100644
--- a/ctdb/tools/ctdb_control.c
+++ b/ctdb/tools/ctdb_control.c
@@ -59,6 +59,7 @@ static void usage(void)
" setmonmode <vnn> <mode> set monitoring mode\n"
" attach <dbname> attach a database\n"
" getpid <vnn> get the pid of a ctdb daemon\n"
+ " dumpmemory <vnn|all> dump memory map to log\n"
" shutdown <vnn> shutdown a remote ctdb\n"
" freeze <vnn|all> freeze a node\n"
" thaw <vnn|all> thaw a node\n"