From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 619 invoked by alias); 13 Jan 2009 21:27:06 -0000 Received: (qmail 610 invoked by alias); 13 Jan 2009 21:27:05 -0000 X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_40,KAM_MX,SPF_HELO_PASS X-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_40,KAM_MX,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com Subject: cluster: STABLE3 - groupd: reduce messages in compat detection To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: f4fcaad172669a2a5fac9bf9c88578f413fe9232 X-Git-Newrev: ec6cf6b7768214b5f380ea42b0c2508b6d668e96 From: David Teigland Message-Id: <20090113212614.9EF29120515@lists.fedorahosted.org> Date: Tue, 13 Jan 2009 21:27:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00118.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ec6cf6b7768214b5f380ea42b0c2508b6d668e96 Commit: ec6cf6b7768214b5f380ea42b0c2508b6d668e96 Parent: f4fcaad172669a2a5fac9bf9c88578f413fe9232 Author: David Teigland AuthorDate: Tue Jan 13 15:21:17 2009 -0600 Committer: David Teigland 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 --- 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; }