cluster: RHEL5 - cman: send fewer messages for each state transition.

Christine Caulfield chrissie@fedoraproject.org
Thu Jun 11 10:05:00 GMT 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=935a60f838d37c848405d7df17404c3adad78392
Commit:        935a60f838d37c848405d7df17404c3adad78392
Parent:        ed2e22dd942b8bb2fcea3a453cc97fda4b5d9020
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Tue Jan 20 14:14:26 2009 +0000
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Thu Jun 11 11:04:55 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.

bz#505258
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 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 a97d244..a67ad5a 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1712,6 +1712,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);
@@ -1732,6 +1734,8 @@ static void do_process_transition(int nodeid, char *data, int len)
 		add_ais_node(nodeid, incarnation, num_ais_nodes);
 	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);
@@ -1791,7 +1795,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))
 	{



More information about the Cluster-cvs mailing list