File cman_calculate_expected_votes_correctly_after_leave_remove.patch of Package cluster

From 10d13e6f288bba93951cda1ee3230dc1e12f6b19 Mon Sep 17 00:00:00 2001
From: Christine Caulfield <ccaulfie@redhat.com>
Date: Wed, 29 Sep 2010 12:02:12 +0100
Subject: [PATCH] cman: Calculate expected_votes correctly after leave remove

When cman_tool leave_remove happens on one node the flag is not cleared
so the same thing happens next time the node just runs "leave". We also
need to keep the recalculated expected votes in the local storage too, or it gets lost when the node leaves again.

Resolves: rhbz#634718

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman/daemon/commands.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index 7a922dd..d4d9fd9 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -2034,6 +2034,7 @@ static void do_process_transition(int nodeid, char *data)
 
 	/* Take into account any new expected_votes value that the new node has */
 	node->expected_votes = msg->expected_votes;
+	us->expected_votes = max(us->expected_votes, msg->expected_votes);
 
 	if (old_state != node->state || old_expected != node->expected_votes)
 		recalculate_quorum(0, 0);
@@ -2246,6 +2247,7 @@ void add_ais_node(int nodeid, uint64_t incar, int total_members)
 		gettimeofday(&node->join_time, NULL);
 		node->incarnation = incar;
 		node->state = NODESTATE_MEMBER;
+		node->leave_reason = 0;
 		cluster_members++;
 		recalculate_quorum(0, 0);
 	}
-- 
1.7.2.3