From: Andrew Tridgell Date: Sun, 22 Apr 2007 16:57:22 +0000 (+0200) Subject: added max_redirect_count status field X-Git-Tag: tevent-0.9.20~348^2~2849 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f651581460b700fb33132aaa60b151b97091962c;p=thirdparty%2Fsamba.git added max_redirect_count status field (This used to be ctdb commit ecea04741fe552aa409ab165d7c69ead9649986c) --- diff --git a/ctdb/common/ctdb_call.c b/ctdb/common/ctdb_call.c index d81cca9e6f3..40bfa1660d1 100644 --- a/ctdb/common/ctdb_call.c +++ b/ctdb/common/ctdb_call.c @@ -605,8 +605,11 @@ void ctdb_reply_redirect(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) if (state == NULL) return; /* don't allow for too many redirects */ - if (state->redirect_count++ == CTDB_MAX_REDIRECT) { + if ((++state->redirect_count) % CTDB_MAX_REDIRECT == 0) { c->dmaster = ctdb_lmaster(ctdb, &state->call.key); + if (state->redirect_count > ctdb->status.max_redirect_count) { + ctdb->status.max_redirect_count = state->redirect_count; + } } /* send it off again */ diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 96ca6d04c95..90d241c200a 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -145,6 +145,7 @@ struct ctdb_status { uint32_t pending_calls; uint32_t lockwait_calls; uint32_t pending_lockwait_calls; + uint32_t max_redirect_count; double max_call_latency; double max_lockwait_latency; }; diff --git a/ctdb/tools/ctdb_status.c b/ctdb/tools/ctdb_status.c index 312decc7e58..97f39d4e16b 100644 --- a/ctdb/tools/ctdb_status.c +++ b/ctdb/tools/ctdb_status.c @@ -55,6 +55,7 @@ static void show_status(struct ctdb_status *s) printf(" pending_calls %u\n", s->pending_calls); printf(" lockwait_calls %u\n", s->lockwait_calls); printf(" pending_lockwait_calls %u\n", s->pending_lockwait_calls); + printf(" max_redirect_count %u\n", s->max_redirect_count); printf(" max_call_latency %.6f seconds\n", s->max_call_latency); printf(" max_lockwait_latency %.6f seconds\n", s->max_lockwait_latency); }