This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE3 - groupd: reduce messages in compat detection


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ec6cf6b7768214b5f380ea42b0c2508b6d668e96
Commit:        ec6cf6b7768214b5f380ea42b0c2508b6d668e96
Parent:        f4fcaad172669a2a5fac9bf9c88578f413fe9232
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Tue Jan 13 15:21:17 2009 -0600
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Tue Jan 13 15:21:17 2009 -0600

groupd: reduce messages in compat detection

When groupd decides it has found an early stable2/rhel5 node due to
the 5 second timeout for receiving a version message, it only needs to
send the proposed compat mode once instead of repeatedly.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 group/daemon/cpg.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/group/daemon/cpg.c b/group/daemon/cpg.c
index 6195d49..8c28ce4 100644
--- a/group/daemon/cpg.c
+++ b/group/daemon/cpg.c
@@ -40,6 +40,7 @@ struct group_node {
 	uint32_t nodeid;
 	uint32_t got_from;
 	int got_version;
+	int sent_version;
 	uint64_t add_time;
 	struct group_version ver;
 	struct list_head list;
@@ -247,7 +248,7 @@ static void receive_version(int from, msg_t *msg, int len)
 void group_mode_check_timeout(void)
 {
 	struct group_node *node;
-	int need_version, pending_count;
+	int need_version, pending_count, sent_count;
 	uint64_t now;
 
 	if (group_mode != GROUP_PENDING)
@@ -263,6 +264,7 @@ void group_mode_check_timeout(void)
 
 	need_version = 0;
 	pending_count = 0;
+	sent_count = 0;
 	now = time(NULL);
 
 	list_for_each_entry(node, &group_nodes, list) {
@@ -270,20 +272,28 @@ void group_mode_check_timeout(void)
 			pending_count++;
 			continue;
 		}
+
 		need_version++;
 
+		if (node->sent_version) {
+			sent_count++;
+			continue;
+		}
+
 		if (now - node->add_time >= cfgd_groupd_wait) {
 			log_print("send version for nodeid %d times %llu %llu",
 				  node->nodeid,
 				  (unsigned long long)node->add_time,
 				  (unsigned long long)now);
 			_send_version(node->nodeid, CLUSTER2, GROUP_LIBGROUP,1);
+			node->sent_version = 1;
+			sent_count++;
 		}
 	}
 
 	if (need_version) {
-		log_debug("group_mode_check_timeout need %d pending %d",
-			  need_version, pending_count);
+		log_debug("group_mode_check_timeout need %d pending %d sent %d",
+			  need_version, pending_count, sent_count);
 		return;
 	}
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]