Rev 182: added max_redirect_count status field in	http://samba.org/~tridge/ctdb ------------------------------------------------------------
revno: 182
revision-id: tridge@samba.org-20070422165722-w0mjfpt1nxg7lu2i
parent: tridge@samba.org-20070422161949-l7agikqiawx4ah1b
committer: Andrew Tridgell 
branch nick: tridge
timestamp: Sun 2007-04-22 18:57:22 +0200
message:
  added max_redirect_count status field
modified:
  common/ctdb_call.c             ctdb_call.c-20061128065342-to93h6eejj5kon81-1
  include/ctdb_private.h         ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  tools/ctdb_status.c            ctdb_status.c-20070420100703-w2y116bm9be7hmlv-2
=== modified file 'common/ctdb_call.c'
--- a/common/ctdb_call.c	2007-04-22 16:19:49 +0000
+++ b/common/ctdb_call.c	2007-04-22 16:57:22 +0000
@@ -605,8 +605,11 @@
 	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 */

=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h	2007-04-22 12:26:45 +0000
+++ b/include/ctdb_private.h	2007-04-22 16:57:22 +0000
@@ -145,6 +145,7 @@
 	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;
 };

=== modified file 'tools/ctdb_status.c'
--- a/tools/ctdb_status.c	2007-04-22 14:39:55 +0000
+++ b/tools/ctdb_status.c	2007-04-22 16:57:22 +0000
@@ -55,6 +55,7 @@
 	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);
 }

