This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: RHEL5 - cman: Fix some latent bugs that will cause upgradeproblems.
- From: Christine Caulfield <chrissie at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Wed, 3 Dec 2008 10:47:26 +0000 (UTC)
- Subject: cluster: RHEL5 - cman: Fix some latent bugs that will cause upgradeproblems.
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=710553766c3b64ef5a3321f4b1833c005f828507
Commit: 710553766c3b64ef5a3321f4b1833c005f828507
Parent: 0385acaf0e2b462f5e7833c2b18f5e7be8ee8362
Author: Christine Caulfield <ccaulfie@redhat.com>
AuthorDate: Wed Dec 3 10:44:28 2008 +0000
Committer: Christine Caulfield <ccaulfie@redhat.com>
CommitterDate: Wed Dec 3 10:44:28 2008 +0000
cman: Fix some latent bugs that will cause upgrade problems.
bz#469868
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
cman/daemon/cmanccs.c | 1 +
cman/daemon/commands.c | 22 +++++++---------------
2 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/cman/daemon/cmanccs.c b/cman/daemon/cmanccs.c
index 0e15cbf..b9fb898 100644
--- a/cman/daemon/cmanccs.c
+++ b/cman/daemon/cmanccs.c
@@ -20,6 +20,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/errno.h>
+#include <limits.h>
#include <netdb.h>
#include <ifaddrs.h>
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index 5579e2d..b07847c 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1725,6 +1725,9 @@ static void do_process_transition(int nodeid, char *data, int len)
msg->flags &= ~NODE_FLAGS_SEESDISALLOWED;
node = find_node_by_nodeid(nodeid);
+ if (!node)
+ add_ais_node(nodeid, incarnation, num_ais_nodes);
+ node = find_node_by_nodeid(nodeid);
assert(node);
P_MEMB("Got TRANSITION message. msg->flags=%x, node->flags=%x, first_trans=%d\n",
@@ -1955,22 +1958,11 @@ void add_ais_node(int nodeid, uint64_t incarnation, int total_members)
/* This really should exist!! */
if (!node) {
char tempname[256];
- node = malloc(sizeof(struct cluster_node));
- if (!node) {
- log_msg(LOG_ERR, "error allocating node struct for id %d, but CCS doesn't know about it anyway\n",
- nodeid);
- return;
- }
- log_msg(LOG_ERR, "Got node from AIS id %d with no CCS entry\n", nodeid);
-
- memset(node, 0, sizeof(struct cluster_node));
- node_add_ordered(node);
- node->state = NODESTATE_DEAD;
- node->votes = 1;
+ log_printf(LOG_ERR, "Got node from AIS id %d with no CCS entry\n", nodeid);
/* Emergency nodename */
sprintf(tempname, "Node%d\n", nodeid);
- node->name = strdup(tempname);
+ node = add_new_node(tempname, nodeid, 1, total_members, NODESTATE_DEAD);
}
if (node->state == NODESTATE_DEAD) {
@@ -2021,9 +2013,9 @@ void del_ais_node(int nodeid)
memset(&node->port_bits, 0, sizeof(node->port_bits));
cluster_members--;
- if ((node->leave_reason & 0xF) & CLUSTER_LEAVEFLAG_REMOVED)
+ if ((node->leave_reason & 0xF) & CLUSTER_LEAVEFLAG_REMOVED)
recalculate_quorum(1, 1);
- else
+ else
recalculate_quorum(0, 0);
break;