]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
added max_redirect_count status field
authorAndrew Tridgell <tridge@samba.org>
Sun, 22 Apr 2007 16:57:22 +0000 (18:57 +0200)
committerAndrew Tridgell <tridge@samba.org>
Sun, 22 Apr 2007 16:57:22 +0000 (18:57 +0200)
(This used to be ctdb commit ecea04741fe552aa409ab165d7c69ead9649986c)

ctdb/common/ctdb_call.c
ctdb/include/ctdb_private.h
ctdb/tools/ctdb_status.c

index d81cca9e6f31bb77cf957239550efe827a44b78c..40bfa1660d1720f7a502116ceb56e741123a9b05 100644 (file)
@@ -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 */
index 96ca6d04c9523a394428aa5cb5a15cb1c2a47e60..90d241c200ac55afb03b63b65a922b59d59d7c96 100644 (file)
@@ -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;
 };
index 312decc7e58fa40f6fcd6105cdbdb0652274acef..97f39d4e16b89069548a9471f3c95838d09cd812 100644 (file)
@@ -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);
 }