From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19439 invoked by alias); 11 Jun 2009 10:03:34 -0000 Received: (qmail 19391 invoked by alias); 11 Jun 2009 10:03:34 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: STABLE2 - cman: send fewer messages for each state transition. To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE2 X-Git-Reftype: branch X-Git-Oldrev: 899f274d7c39dda624325d1b6a0141377b1af038 X-Git-Newrev: bdfd266ad5190c106ebc62ba4054f6b94725ff66 From: Christine Caulfield Message-Id: <20090611100304.05948120360@lists.fedorahosted.org> Date: Thu, 11 Jun 2009 10:03: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-q2/txt/msg00501.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=bdfd266ad5190c106ebc62ba4054f6b94725ff66 Commit: bdfd266ad5190c106ebc62ba4054f6b94725ff66 Parent: 899f274d7c39dda624325d1b6a0141377b1af038 Author: Christine Caulfield AuthorDate: Tue Jan 20 14:14:26 2009 +0000 Committer: Christine Caulfield CommitterDate: Thu Jun 11 11:02:57 2009 +0100 cman: send fewer messages for each state transition. Only recalculate quorum (and tell everyone the result) if a node state has actually changed. Signed-off-by: Christine Caulfield --- cman/daemon/commands.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c index a592e7f..cf2f47a 100644 --- a/cman/daemon/commands.c +++ b/cman/daemon/commands.c @@ -1706,6 +1706,8 @@ static void do_process_transition(int nodeid, char *data, int len) { struct cl_transmsg *msg = (struct cl_transmsg *)data; struct cluster_node *node; + unsigned int old_expected; + nodestate_t old_state; if (valid_transition_msg(nodeid, msg) != 0) { P_MEMB("Transition message from %d does not match current config - should quit ?\n", nodeid); @@ -1727,6 +1729,8 @@ static void do_process_transition(int nodeid, char *data, int len) node = find_node_by_nodeid(nodeid); } assert(node); + old_expected = node->expected_votes; + old_state = node->state; P_MEMB("Got TRANSITION message. msg->flags=%x, node->flags=%x, first_trans=%d\n", msg->flags, node->flags, msg->first_trans); @@ -1787,7 +1791,9 @@ static void do_process_transition(int nodeid, char *data, int len) /* Take into account any new expected_votes value that the new node has */ node->expected_votes = msg->expected_votes; - recalculate_quorum(0, 0); + + if (old_state != node->state || old_expected != node->expected_votes) + recalculate_quorum(0, 0); if (node->fence_agent && msg->fence_agent[0] && strcmp(node->fence_agent, msg->fence_agent)) {