summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2013-09-06 14:51:54 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-09-25 14:59:45 +1000
commit76d9d2e5e197ed129d002c5be9edad705b15b4ee (patch)
tree6ae463d001ab491d8c9ad3e1ea7196cdcb06e3b2 /ctdb
parent613313fa52f06d9821680296515d1d5ea30262cb (diff)
downloadsamba-76d9d2e5e197ed129d002c5be9edad705b15b4ee.tar.gz
traverse: Log information when traverse starts and ends
Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit e4aba8598b00a810e721de64ac44dccc9af04ab6)
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/server/ctdb_traverse.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ctdb/server/ctdb_traverse.c b/ctdb/server/ctdb_traverse.c
index 4edae504aa3..e37ba9c2dae 100644
--- a/ctdb/server/ctdb_traverse.c
+++ b/ctdb/server/ctdb_traverse.c
@@ -279,6 +279,7 @@ struct traverse_start_state {
uint32_t db_id;
uint64_t srvid;
bool withemptyrecords;
+ int num_records;
};
@@ -381,6 +382,9 @@ static struct ctdb_traverse_all_handle *ctdb_daemon_traverse_all(struct ctdb_db_
return NULL;
}
+ DEBUG(DEBUG_NOTICE,("Starting traverse on DB %s (id %d)\n",
+ ctdb_db->db_name, state->reqid));
+
/* timeout the traverse */
event_add_timed(ctdb->ev, state,
timeval_current_ofs(ctdb->tunable.traverse_timeout, 0),
@@ -643,6 +647,10 @@ static void traverse_start_callback(void *p, TDB_DATA key, TDB_DATA data)
ctdb_dispatch_message(state->ctdb, state->srvid, cdata);
if (key.dsize == 0 && data.dsize == 0) {
+ DEBUG(DEBUG_NOTICE, ("Ending traverse on DB %s (id %d), records %d\n",
+ state->h->ctdb_db->db_name, state->h->reqid,
+ state->num_records));
+
if (state->h->timedout) {
/* timed out, send TRAVERSE_KILL control */
talloc_free(state);
@@ -651,6 +659,8 @@ static void traverse_start_callback(void *p, TDB_DATA key, TDB_DATA data)
talloc_set_destructor(state, NULL);
talloc_free(state);
}
+ } else {
+ state->num_records++;
}
}
@@ -706,8 +716,7 @@ int32_t ctdb_control_traverse_start_ext(struct ctdb_context *ctdb,
state->db_id = d->db_id;
state->ctdb = ctdb;
state->withemptyrecords = d->withemptyrecords;
-
- DEBUG(DEBUG_NOTICE,("Stating traverse on DB %s\n", ctdb_db->db_name));
+ state->num_records = 0;
state->h = ctdb_daemon_traverse_all(ctdb_db, traverse_start_callback, state);
if (state->h == NULL) {