This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: master - cman: optimise messages sent.
- From: Christine Caulfield <chrissie at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Tue, 20 Jan 2009 14:07:07 +0000 (UTC)
- Subject: cluster: master - cman: optimise messages sent.
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=adb1a75dd81511c2a843aa48a78bb62209ea128f
Commit: adb1a75dd81511c2a843aa48a78bb62209ea128f
Parent: aada21705ee7e6a9cd887512b6b44fc626cd16ed
Author: Christine Caulfield <ccaulfie@redhat.com>
AuthorDate: Tue Jan 20 14:06:32 2009 +0000
Committer: Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Tue Jan 20 14:06:32 2009 +0000
cman: optimise messages sent.
We sent far too many messages when nodes joined/left before.
This reduces them considerably.
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
cman/services/quorum/services/cmanquorum.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/cman/services/quorum/services/cmanquorum.c b/cman/services/quorum/services/cmanquorum.c
index 4f194ee..510c392 100644
--- a/cman/services/quorum/services/cmanquorum.c
+++ b/cman/services/quorum/services/cmanquorum.c
@@ -977,6 +977,9 @@ static void message_handler_req_exec_quorum_nodeinfo (
{
struct req_exec_quorum_nodeinfo *req_exec_quorum_nodeinfo = (struct req_exec_quorum_nodeinfo *)message;
struct cluster_node *node;
+ int old_votes;
+ int old_expected;
+ nodestate_t old_state;
ENTER();
log_printf(LOG_LEVEL_DEBUG, "got nodeinfo message from cluster node %d\n", nodeid);
@@ -990,12 +993,19 @@ static void message_handler_req_exec_quorum_nodeinfo (
return;
}
+ /*
+ * If the node sending the message sees disallowed nodes and we don't, then
+ * we have to leave
+ */
if (req_exec_quorum_nodeinfo->flags & NODE_FLAGS_SEESDISALLOWED && !have_disallowed()) {
/* Must use syslog directly here or the message will never arrive */
syslog(LOG_CRIT, "[CMANQ]: Joined a cluster with disallowed nodes. must die");
corosync_api->fatal_error(2, __FILE__, __LINE__);
exit(2);
}
+ old_votes = node->votes;
+ old_expected = node->expected_votes;
+ old_state = node->state;
/* Update node state */
if (req_exec_quorum_nodeinfo->minor_version >= 2)
@@ -1022,8 +1032,8 @@ static void message_handler_req_exec_quorum_nodeinfo (
}
node->flags &= ~NODE_FLAGS_BEENDOWN;
- // TODO do we need this as well as in confchg ?
- recalculate_quorum(0);
+ if (old_votes != node->votes || old_expected != node->expected_votes || old_state != node->state)
+ recalculate_quorum(0);
LEAVE();
}