public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL54 - cman: send fewer messages for each state transition.
@ 2009-06-22  8:07 Christine Caulfield
  0 siblings, 0 replies; 2+ messages in thread
From: Christine Caulfield @ 2009-06-22  8:07 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=54abe6db5a5bd10f8958732b938d9c09cb23e566
Commit:        54abe6db5a5bd10f8958732b938d9c09cb23e566
Parent:        2660846721573a2a2a3bef3318df96bae4ce5f32
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Tue Jan 20 14:14:26 2009 +0000
Committer:     Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Mon Jun 22 09:06:04 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#506768
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 03c7426..710449e 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))
 	{


^ permalink raw reply	[flat|nested] 2+ messages in thread
* cluster: RHEL54 - cman: send fewer messages for each state transition.
@ 2009-07-22 16:33 Chris Feist
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Feist @ 2009-07-22 16:33 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=32bcee3c03818e5fe65751ade92308a35809e08f
Commit:        32bcee3c03818e5fe65751ade92308a35809e08f
Parent:        4478238a116b9c0720e88ff83e7f6cd8fde3c6ad
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Tue Jan 20 14:14:26 2009 +0000
Committer:     Chris Feist <cfeist@redhat.com>
CommitterDate: Wed Jul 22 11:05:02 2009 -0500

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 03c7426..710449e 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))
 	{


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-22 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-22  8:07 cluster: RHEL54 - cman: send fewer messages for each state transition Christine Caulfield
2009-07-22 16:33 Chris Feist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).