cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2008-01-02 16:23 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2008-01-02 16:23 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2008-01-02 16:23:29

Modified files:
	cman/daemon    : commands.c 

Log message:
	Lets see if I can do this commit properly...
	Fix swab of an int to be swab32 rather than swab16

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.78&r2=1.79

--- cluster/cman/daemon/commands.c	2008/01/02 09:27:12	1.78
+++ cluster/cman/daemon/commands.c	2008/01/02 16:23:28	1.79
@@ -1627,7 +1627,7 @@
 	case CLUSTER_MSG_KILLNODE:
 		killmsg = (struct cl_killmsg *)data;
 		killmsg->reason = swab16(killmsg->reason);
-		killmsg->nodeid = swab16(killmsg->nodeid);
+		killmsg->nodeid = swab32(killmsg->nodeid);
 		break;
 
 	case CLUSTER_MSG_LEAVE:



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2008-02-04 10:54 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2008-02-04 10:54 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2008-02-04 10:54:26

Modified files:
	cman/daemon    : commands.c 

Log message:
	Change a log_printf() into a syslog() so that the die message
	always arrives in the log.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.82&r2=1.83

--- cluster/cman/daemon/commands.c	2008/01/03 16:35:54	1.82
+++ cluster/cman/daemon/commands.c	2008/02/04 10:54:26	1.83
@@ -1889,7 +1889,8 @@
 		killmsg = (struct cl_killmsg *)data;
 		P_MEMB("got KILL for node %d\n", killmsg->nodeid);
 		if (killmsg->nodeid == wanted_nodeid) {
-			log_printf(LOG_INFO, "cman killed by node %d because %s\n", nodeid,
+			/* Must use syslog directly here or the message will never arrive */
+			syslog(LOG_CRIT, "cman killed by node %d because %s\n", nodeid,
 				killmsg_reason(killmsg->reason));
 			exit(1);
 		}



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2008-01-03 16:36 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2008-01-03 16:36 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2008-01-03 16:36:52

Modified files:
	cman/daemon    : commands.c 

Log message:
	Get rid of redundant totemip_parse() call. This was in a bad place and could
	cause aisexec stalls and disallowed nodes, particularly at startup.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.16&r2=1.55.2.17

--- cluster/cman/daemon/commands.c	2008/01/02 10:02:44	1.55.2.16
+++ cluster/cman/daemon/commands.c	2008/01/03 16:36:51	1.55.2.17
@@ -1924,23 +1924,8 @@
 /* Add a node from CCS, note that it may already exist if user has simply updated the config file */
 void add_ccs_node(char *nodename, int nodeid, int votes, int expected_votes)
 {
-	struct totem_ip_address ipaddr;
-	struct cluster_node *node;
-
-	if (totemip_parse(&ipaddr, nodename, 0))
-	{
-		if (!nodeid) {
-			log_msg(LOG_ERR, "Error, can't find IP address and no nodeid for node %s - ignoring it\n", nodename);
-			return;
-		}
-		else {
-			log_msg(LOG_WARNING, "Warning, can't resolve IP address for node %s\n", nodename);
-			memset(&ipaddr, 0, sizeof(ipaddr));
-		}
-	}
-
 	/* Update node entry */
-	node = add_new_node(nodename, nodeid, votes, expected_votes, NODESTATE_DEAD);
+	add_new_node(nodename, nodeid, votes, expected_votes, NODESTATE_DEAD);
 }
 
 void add_ais_node(int nodeid, uint64_t incarnation, int total_members)



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2008-01-03 16:35 pcaulfield
  2008-01-03 20:40 ` Fabio M. Di Nitto
  0 siblings, 1 reply; 35+ messages in thread
From: pcaulfield @ 2008-01-03 16:35 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2008-01-03 16:35:55

Modified files:
	cman/daemon    : commands.c 

Log message:
	Get rid of redundant totemip_parse() call. This was in a bad place and could
	cause aisexec stalls and disallowed nodes, particularly at startup.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.81&r2=1.82

--- cluster/cman/daemon/commands.c	2008/01/03 06:48:12	1.81
+++ cluster/cman/daemon/commands.c	2008/01/03 16:35:54	1.82
@@ -1955,23 +1955,8 @@
 /* Add a node from CCS, note that it may already exist if user has simply updated the config file */
 void add_ccs_node(char *nodename, int nodeid, int votes, int expected_votes)
 {
-	struct totem_ip_address ipaddr;
-	struct cluster_node *node;
-
-	if (totemip_parse(&ipaddr, nodename, 0))
-	{
-		if (!nodeid) {
-			log_printf(LOG_ERR, "Error, can't find IP address and no nodeid for node %s - ignoring it\n", nodename);
-			return;
-		}
-		else {
-			log_printf(LOG_WARNING, "Warning, can't resolve IP address for node %s\n", nodename);
-			memset(&ipaddr, 0, sizeof(ipaddr));
-		}
-	}
-
 	/* Update node entry */
-	node = add_new_node(nodename, nodeid, votes, expected_votes, NODESTATE_DEAD);
+	add_new_node(nodename, nodeid, votes, expected_votes, NODESTATE_DEAD);
 }
 
 void add_ais_node(int nodeid, uint64_t incarnation, int total_members)



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2008-01-03  6:48 fabbione
  0 siblings, 0 replies; 35+ messages in thread
From: fabbione @ 2008-01-03  6:48 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	fabbione at sourceware.org	2008-01-03 06:48:12

Modified files:
	cman/daemon    : commands.c 

Log message:
	Fix buffer align. So far this one makes the entire stack run on sparc
	up to fenced.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.80&r2=1.81

--- cluster/cman/daemon/commands.c	2008/01/02 16:35:44	1.80
+++ cluster/cman/daemon/commands.c	2008/01/03 06:48:12	1.81
@@ -1555,7 +1555,7 @@
 
 void send_transition_msg(int last_memb_count, int first_trans)
 {
-	char buf[sizeof(struct cl_transmsg)+1024];
+	char buf[sizeof(struct cl_transmsg)+1024] __attribute__((aligned(8)));
 	struct cl_transmsg *msg = (struct cl_transmsg *)buf;
 	int len = sizeof(struct cl_transmsg);
 



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2008-01-02 10:02 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2008-01-02 10:02 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2008-01-02 10:02:44

Modified files:
	cman/daemon    : commands.c 

Log message:
	totempg_ifaces_get() always copies INTERFACE_MAX addresses
	so make sure we allocate enough space for them all.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.15&r2=1.55.2.16

--- cluster/cman/daemon/commands.c	2007/11/26 17:02:59	1.55.2.15
+++ cluster/cman/daemon/commands.c	2008/01/02 10:02:44	1.55.2.16
@@ -2,7 +2,7 @@
 *******************************************************************************
 **
 **  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
+**  Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
 **
 **  This copyrighted material is made available to anyone wishing to use,
 **  modify, copy, or redistribute it subject to the terms and conditions
@@ -343,7 +343,7 @@
 	int addrlen=0;
 	unsigned int numaddrs=1;
 	char **status;
-	struct totem_ip_address node_ifs[num_interfaces];
+	struct totem_ip_address node_ifs[INTERFACE_MAX];
 
 	strcpy(unode->name, node->name);
 	unode->jointime = node->join_time;
@@ -1150,7 +1150,7 @@
 	int i;
 	char *outbuf = *retbuf + offset;
 	struct cl_get_node_addrs *addrs = (struct cl_get_node_addrs *)outbuf;
-	struct totem_ip_address node_ifs[num_interfaces];
+	struct totem_ip_address node_ifs[INTERFACE_MAX];
 	struct cluster_node *node;
 	char **status;
 



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2008-01-02  9:27 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2008-01-02  9:27 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2008-01-02 09:27:12

Modified files:
	cman/daemon    : commands.c 

Log message:
	totempg_ifaces_get() always copies INTERFACE_MAX addresses
	so make sure we alloate enough space for them all.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.77&r2=1.78

--- cluster/cman/daemon/commands.c	2007/12/05 14:28:58	1.77
+++ cluster/cman/daemon/commands.c	2008/01/02 09:27:12	1.78
@@ -345,7 +345,8 @@
 	int addrlen=0;
 	unsigned int numaddrs=1;
 	char **status;
-	struct totem_ip_address node_ifs[num_interfaces];
+	struct totem_ip_address node_ifs[INTERFACE_MAX];
+	/* totempg_ifaces_get always copies INTERFACE_MAX addresses */
 
 	strcpy(unode->name, node->name);
 	unode->jointime = node->join_time;
@@ -361,7 +362,6 @@
 	   must ask for them */
 	totempg_ifaces_get(node->node_id, node_ifs, &status, &numaddrs);
 
-
 	totemip_totemip_to_sockaddr_convert(&node_ifs[0], 0, &ss, &addrlen);
 	memcpy(unode->addr, &ss, addrlen);
 	unode->addrlen = addrlen;
@@ -1173,7 +1173,7 @@
 	int i;
 	char *outbuf = *retbuf + offset;
 	struct cl_get_node_addrs *addrs = (struct cl_get_node_addrs *)outbuf;
-	struct totem_ip_address node_ifs[num_interfaces];
+	struct totem_ip_address node_ifs[INTERFACE_MAX]; /* totempg_ifaces_get always copies INTERFACE_MAX addresses */
 	struct cluster_node *node;
 	char **status;
 



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-11-26 17:03 lhh
  0 siblings, 0 replies; 35+ messages in thread
From: lhh @ 2007-11-26 17:03 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	lhh at sourceware.org	2007-11-26 17:03:00

Modified files:
	cman/daemon    : commands.c 

Log message:
	Ancillary patch to fix another case; bz #327721

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.14&r2=1.55.2.15

--- cluster/cman/daemon/commands.c	2007/11/20 09:21:51	1.55.2.14
+++ cluster/cman/daemon/commands.c	2007/11/26 17:02:59	1.55.2.15
@@ -2021,6 +2021,7 @@
 
 	case NODESTATE_LEAVING:
 		node->state = NODESTATE_DEAD;
+		memset(&node->port_bits, 0, sizeof(node->port_bits));
 		cluster_members--;
 
 		if ((node->leave_reason & 0xF) & CLUSTER_LEAVEFLAG_REMOVED) 



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-11-20  9:21 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-11-20  9:21 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2007-11-20 09:21:51

Modified files:
	cman/daemon    : commands.c 

Log message:
	Clear out the ports list of a remote node when it goes down. Otherwise
	we will lose portopened messages when it comes back up.
	Thanks for lon for testing & patch.
	bz#327721

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.13&r2=1.55.2.14

--- cluster/cman/daemon/commands.c	2007/09/27 09:05:45	1.55.2.13
+++ cluster/cman/daemon/commands.c	2007/11/20 09:21:51	1.55.2.14
@@ -2010,6 +2010,7 @@
 	switch (node->state) {
 	case NODESTATE_MEMBER:
 		node->state = NODESTATE_DEAD;
+		memset(&node->port_bits, 0, sizeof(node->port_bits));
 		cluster_members--;
 		recalculate_quorum(0, 0);
 		break;



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-11-20  9:02 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-11-20  9:02 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-11-20 09:02:10

Modified files:
	cman/daemon    : commands.c 

Log message:
	Clear out the ports opened list when a node goes down.
	Thanks, Lon.
	bz#327721

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.74&r2=1.75

--- cluster/cman/daemon/commands.c	2007/11/05 15:15:53	1.74
+++ cluster/cman/daemon/commands.c	2007/11/20 09:02:10	1.75
@@ -2021,6 +2021,7 @@
 	switch (node->state) {
 	case NODESTATE_MEMBER:
 		node->state = NODESTATE_DEAD;
+		memset(&node->port_bits, 0, sizeof(node->port_bits));
 		cluster_members--;
 		recalculate_quorum(0, 0);
 		break;



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-09-27  9:05 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-09-27  9:05 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2007-09-27 09:05:45

Modified files:
	cman/daemon    : commands.c 

Log message:
	Recalculate quorum when we have a new node's expected_votes.
	bz#308581

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.12&r2=1.55.2.13

--- cluster/cman/daemon/commands.c	2007/09/17 13:48:15	1.55.2.12
+++ cluster/cman/daemon/commands.c	2007/09/27 09:05:45	1.55.2.13
@@ -1770,6 +1770,11 @@
 		node->state = NODESTATE_AISONLY;
 
 	node->flags = msg->flags; /* This will clear the BEENDOWN flag of course */
+
+	/* Take into account any new expected_votes value that the new node has */
+	node->expected_votes = msg->expected_votes;
+	recalculate_quorum(0, 0);
+
 	if (node->fence_agent && msg->fence_agent[0] && strcmp(node->fence_agent, msg->fence_agent))
 	{
 		free(node->fence_agent);



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-09-27  9:01 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-09-27  9:01 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-09-27 09:01:30

Modified files:
	cman/daemon    : commands.c 

Log message:
	Recalculate quorum based on the expected votes value of a new node.
	bz#308581

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.71&r2=1.72

--- cluster/cman/daemon/commands.c	2007/09/17 08:03:36	1.71
+++ cluster/cman/daemon/commands.c	2007/09/27 09:01:30	1.72
@@ -1771,6 +1771,11 @@
 		node->state = NODESTATE_AISONLY;
 
 	node->flags = msg->flags; /* This will clear the BEENDOWN flag of course */
+
+	/* Take into account any new expected_votes value that the new node has */
+	node->expected_votes = msg->expected_votes;
+	recalculate_quorum(0, 0);
+
 	if (node->fence_agent && msg->fence_agent[0] && strcmp(node->fence_agent, msg->fence_agent))
 	{
 		free(node->fence_agent);



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-09-17 13:35 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-09-17 13:35 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2007-09-17 13:35:35

Modified files:
	cman/daemon    : commands.c 

Log message:
	Correctly reduce quorum when a node leaves using "cman_tool leave remove"
	bz#271701

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.10&r2=1.55.2.11

--- cluster/cman/daemon/commands.c	2007/09/17 13:22:31	1.55.2.10
+++ cluster/cman/daemon/commands.c	2007/09/17 13:35:35	1.55.2.11
@@ -95,7 +95,7 @@
 static int send_port_open_msg(unsigned char port);
 static int send_port_enquire(int nodeid);
 static void process_internal_message(char *data, int len, int nodeid, int byteswap);
-static void recalculate_quorum(int allow_decrease);
+static void recalculate_quorum(int allow_decrease, int by_current_nodes);
 static void send_kill(int nodeid, uint16_t reason);
 static char *killmsg_reason(int reason);
 
@@ -326,11 +326,11 @@
 }
 
 /* Recalculate cluster quorum, set quorate and notify changes */
-static void recalculate_quorum(int allow_decrease)
+static void recalculate_quorum(int allow_decrease, int by_current_nodes)
 {
 	unsigned int total_votes;
 
-	quorum = calculate_quorum(allow_decrease, 0, &total_votes);
+	quorum = calculate_quorum(allow_decrease, by_current_nodes?cluster_members:0, &total_votes);
 	set_quorate(total_votes);
 	notify_listeners(NULL, EVENT_REASON_STATECHANGE, 0);
 }
@@ -790,7 +790,7 @@
 		return -EINVAL;
 	}
 
-	recalculate_quorum(1);
+	recalculate_quorum(1, 0);
 
 	send_reconfigure(arg.nodeid, RECONFIG_PARAM_NODE_VOTES, arg.newvotes);
 
@@ -1033,7 +1033,7 @@
 	else {
 		log_msg(LOG_ERR, "Now got CCS information version %d, continuing\n", config_version);
 		config_error = 0;
-		recalculate_quorum(0);
+		recalculate_quorum(0, 0);
 	}
 }
 
@@ -1048,7 +1048,7 @@
 	if (quorum_device->last_hello.tv_sec + quorumdev_poll/1000 < now.tv_sec) {
 		quorum_device->state = NODESTATE_DEAD;
 		log_msg(LOG_INFO, "lost contact with quorum device\n");
-		recalculate_quorum(0);
+		recalculate_quorum(0, 0);
 	}
 	else {
 		openais_timer_add_duration((unsigned long long)quorumdev_poll*1000000, quorum_device,
@@ -1069,7 +1069,7 @@
 		gettimeofday(&quorum_device->last_hello, NULL);
                 if (quorum_device->state == NODESTATE_DEAD) {
                         quorum_device->state = NODESTATE_MEMBER;
-                        recalculate_quorum(0);
+                        recalculate_quorum(0, 0);
 
 			openais_timer_add_duration((unsigned long long)quorumdev_poll*1000000, quorum_device,
 						   quorum_device_timer_fn, &quorum_device_timer);
@@ -1078,7 +1078,7 @@
         else {
                 if (quorum_device->state == NODESTATE_MEMBER) {
                         quorum_device->state = NODESTATE_DEAD;
-                        recalculate_quorum(0);
+                        recalculate_quorum(0, 0);
 			openais_timer_delete(quorum_device_timer);
                 }
         }
@@ -1504,7 +1504,7 @@
 		if (config_version > msg->config_version) {
 			// TODO tell everyone else to update...
 		}
-		recalculate_quorum(0);
+		recalculate_quorum(0, 0);
 	}
 
 
@@ -1641,12 +1641,12 @@
 				node->expected_votes = msg->value;
 			}
 		}
-		recalculate_quorum(1);  /* Allow decrease */
+		recalculate_quorum(1, 0);  /* Allow decrease */
 		break;
 
 	case RECONFIG_PARAM_NODE_VOTES:
 		node->votes = msg->value;
-		recalculate_quorum(1);  /* Allow decrease */
+		recalculate_quorum(1, 0);  /* Allow decrease */
 		break;
 
 	case RECONFIG_PARAM_CONFIG_VERSION:
@@ -1655,7 +1655,7 @@
 				msg->value);
 
 			config_error = 1;
-			recalculate_quorum(0);
+			recalculate_quorum(0, 0);
 
 			wanted_config_version = config_version;
 			openais_timer_add_duration((unsigned long long)ccsd_poll_interval*1000000, NULL,
@@ -1968,7 +1968,7 @@
 		node->incarnation = incarnation;
 		node->state = NODESTATE_MEMBER;
 		cluster_members++;
-		recalculate_quorum(0);
+		recalculate_quorum(0, 0);
 	}
 }
 
@@ -1998,7 +1998,7 @@
 	case NODESTATE_MEMBER:
 		node->state = NODESTATE_DEAD;
 		cluster_members--;
-		recalculate_quorum(0);
+		recalculate_quorum(0, 0);
 		break;
 
 	case NODESTATE_AISONLY:
@@ -2009,10 +2009,10 @@
 		node->state = NODESTATE_DEAD;
 		cluster_members--;
 
-		if ((node->leave_reason & 0xF) == CLUSTER_LEAVEFLAG_REMOVED)
-			recalculate_quorum(1);
-		else
-			recalculate_quorum(0);
+		if ((node->leave_reason & 0xF) & CLUSTER_LEAVEFLAG_REMOVED) 
+			recalculate_quorum(1, 1);
+		else 
+			recalculate_quorum(0, 0);
 		break;
 
 	case NODESTATE_JOINING:



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-09-07 12:17 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-09-07 12:17 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-09-07 12:17:45

Modified files:
	cman/daemon    : commands.c 

Log message:
	Correctly reduce quorum when a node leaves using "cman_tool leave remove"
	bz#271701

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.69&r2=1.70

--- cluster/cman/daemon/commands.c	2007/08/28 16:51:39	1.69
+++ cluster/cman/daemon/commands.c	2007/09/07 12:17:45	1.70
@@ -96,7 +96,7 @@
 static int send_port_open_msg(unsigned char port);
 static int send_port_enquire(int nodeid);
 static void process_internal_message(char *data, int len, int nodeid, int byteswap);
-static void recalculate_quorum(int allow_decrease);
+static void recalculate_quorum(int allow_decrease, int by_current_nodes);
 static void send_kill(int nodeid, uint16_t reason);
 static char *killmsg_reason(int reason);
 
@@ -327,11 +327,11 @@
 }
 
 /* Recalculate cluster quorum, set quorate and notify changes */
-static void recalculate_quorum(int allow_decrease)
+static void recalculate_quorum(int allow_decrease, int by_current_nodes)
 {
 	unsigned int total_votes;
 
-	quorum = calculate_quorum(allow_decrease, 0, &total_votes);
+	quorum = calculate_quorum(allow_decrease, by_current_nodes?cluster_members:0, &total_votes);
 	set_quorate(total_votes);
 	notify_listeners(NULL, EVENT_REASON_STATECHANGE, 0);
 }
@@ -791,7 +791,7 @@
 		return -EINVAL;
 	}
 
-	recalculate_quorum(1);
+	recalculate_quorum(1, 0);
 
 	send_reconfigure(arg.nodeid, RECONFIG_PARAM_NODE_VOTES, arg.newvotes);
 
@@ -1034,7 +1034,7 @@
 	else {
 		log_msg(LOG_ERR, "Now got CCS information version %d, continuing\n", config_version);
 		config_error = 0;
-		recalculate_quorum(0);
+		recalculate_quorum(0, 0);
 	}
 }
 
@@ -1049,7 +1049,7 @@
 	if (quorum_device->last_hello.tv_sec + quorumdev_poll/1000 < now.tv_sec) {
 		quorum_device->state = NODESTATE_DEAD;
 		log_msg(LOG_INFO, "lost contact with quorum device\n");
-		recalculate_quorum(0);
+		recalculate_quorum(0, 0);
 	}
 	else {
 		openais_timer_add_duration((unsigned long long)quorumdev_poll*1000000, quorum_device,
@@ -1070,7 +1070,7 @@
 		gettimeofday(&quorum_device->last_hello, NULL);
                 if (quorum_device->state == NODESTATE_DEAD) {
                         quorum_device->state = NODESTATE_MEMBER;
-                        recalculate_quorum(0);
+                        recalculate_quorum(0, 0);
 
 			openais_timer_add_duration((unsigned long long)quorumdev_poll*1000000, quorum_device,
 						   quorum_device_timer_fn, &quorum_device_timer);
@@ -1079,7 +1079,7 @@
         else {
                 if (quorum_device->state == NODESTATE_MEMBER) {
                         quorum_device->state = NODESTATE_DEAD;
-                        recalculate_quorum(0);
+                        recalculate_quorum(0, 0);
 			openais_timer_delete(quorum_device_timer);
                 }
         }
@@ -1513,7 +1513,7 @@
 		if (config_version > msg->config_version) {
 			// TODO tell everyone else to update...
 		}
-		recalculate_quorum(0);
+		recalculate_quorum(0, 0);
 	}
 
 
@@ -1650,12 +1650,12 @@
 				node->expected_votes = msg->value;
 			}
 		}
-		recalculate_quorum(1);  /* Allow decrease */
+		recalculate_quorum(1, 0);  /* Allow decrease */
 		break;
 
 	case RECONFIG_PARAM_NODE_VOTES:
 		node->votes = msg->value;
-		recalculate_quorum(1);  /* Allow decrease */
+		recalculate_quorum(1, 0);  /* Allow decrease */
 		break;
 
 	case RECONFIG_PARAM_CONFIG_VERSION:
@@ -1664,7 +1664,7 @@
 				msg->value);
 
 			config_error = 1;
-			recalculate_quorum(0);
+			recalculate_quorum(0, 0);
 
 			wanted_config_version = config_version;
 			openais_timer_add_duration((unsigned long long)ccsd_poll_interval*1000000, NULL,
@@ -1977,7 +1977,7 @@
 		node->incarnation = incarnation;
 		node->state = NODESTATE_MEMBER;
 		cluster_members++;
-		recalculate_quorum(0);
+		recalculate_quorum(0, 0);
 	}
 }
 
@@ -2007,7 +2007,7 @@
 	case NODESTATE_MEMBER:
 		node->state = NODESTATE_DEAD;
 		cluster_members--;
-		recalculate_quorum(0);
+		recalculate_quorum(0, 0);
 		break;
 
 	case NODESTATE_AISONLY:
@@ -2018,10 +2018,10 @@
 		node->state = NODESTATE_DEAD;
 		cluster_members--;
 
-		if ((node->leave_reason & 0xF) == CLUSTER_LEAVEFLAG_REMOVED)
-			recalculate_quorum(1);
-		else
-			recalculate_quorum(0);
+		if ((node->leave_reason & 0xF) & CLUSTER_LEAVEFLAG_REMOVED) 
+			recalculate_quorum(1, 1);
+		else 
+			recalculate_quorum(0, 0);
 		break;
 
 	case NODESTATE_JOINING:



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-08-22  7:05 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-08-22  7:05 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-08-22 07:05:58

Modified files:
	cman/daemon    : commands.c 

Log message:
	Clear error flag for SET_DIRTY

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.66&r2=1.67

--- cluster/cman/daemon/commands.c	2007/08/20 14:37:26	1.66
+++ cluster/cman/daemon/commands.c	2007/08/22 07:05:58	1.67
@@ -1211,6 +1211,7 @@
 
 	case CMAN_CMD_SET_DIRTY:
 		us->flags |= NODE_FLAGS_DIRTY;
+		err = 0;
 		break;
 
 	case CMAN_CMD_START_CONFCHG:



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-17 15:02 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-01-17 15:02 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-01-17 15:02:50

Modified files:
	cman/daemon    : commands.c 

Log message:
	Fix typo.
	thanks Bob.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.60&r2=1.61

--- cluster/cman/daemon/commands.c	2007/01/17 11:00:40	1.60
+++ cluster/cman/daemon/commands.c	2007/01/17 15:02:49	1.61
@@ -2055,7 +2055,7 @@
 		return "we were killed by cman_tool or other application";
 
 	case CLUSTER_KILL_REJOIN:
-		return "we node rejoined cluster without a full restart";
+		return "we rejoined the cluster without a full restart";
 
 	default:
 		sprintf(msg, "we got kill message number %d", reason);



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-17 15:02 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-01-17 15:02 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2007-01-17 15:02:13

Modified files:
	cman/daemon    : commands.c 

Log message:
	Fix typo,
	thanks bob.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.5&r2=1.55.2.6

--- cluster/cman/daemon/commands.c	2007/01/17 11:01:35	1.55.2.5
+++ cluster/cman/daemon/commands.c	2007/01/17 15:02:13	1.55.2.6
@@ -2055,7 +2055,7 @@
 		return "we were killed by cman_tool or other application";
 
 	case CLUSTER_KILL_REJOIN:
-		return "we node rejoined cluster without a full restart";
+		return "we rejoined the cluster without a full restart";
 
 	default:
 		sprintf(msg, "we got kill message number %d", reason);



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-17 11:01 pcaulfield
  2007-01-17 14:50 ` Robert Peterson
  0 siblings, 1 reply; 35+ messages in thread
From: pcaulfield @ 2007-01-17 11:01 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2007-01-17 11:01:35

Modified files:
	cman/daemon    : commands.c 

Log message:
	If we get killed by another node then print the reason in English rather
	than just a number.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.4&r2=1.55.2.5

--- cluster/cman/daemon/commands.c	2007/01/16 09:57:20	1.55.2.4
+++ cluster/cman/daemon/commands.c	2007/01/17 11:01:35	1.55.2.5
@@ -2,7 +2,7 @@
 *******************************************************************************
 **
 **  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-**  Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
+**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
 **
 **  This copyrighted material is made available to anyone wishing to use,
 **  modify, copy, or redistribute it subject to the terms and conditions
@@ -97,6 +97,7 @@
 static void process_internal_message(char *data, int len, int nodeid, int byteswap);
 static void recalculate_quorum(int allow_decrease);
 static void send_kill(int nodeid, uint16_t reason);
+static char *killmsg_reason(int reason);
 
 static void set_port_bit(struct cluster_node *node, uint8_t port)
 {
@@ -1817,7 +1818,8 @@
 		killmsg = (struct cl_killmsg *)data;
 		P_MEMB("got KILL for node %d\n", killmsg->nodeid);
 		if (killmsg->nodeid == wanted_nodeid) {
-			log_msg(LOG_INFO, "cman killed by node %d for reason %d\n", nodeid, killmsg->reason);
+			log_msg(LOG_INFO, "cman killed by node %d because %s\n", nodeid,
+				killmsg_reason(killmsg->reason));
 			exit(1);
 		}
 		break;
@@ -2040,3 +2042,23 @@
 	return NULL;
 }
 
+static char *killmsg_reason(int reason)
+{
+	static char msg[1024];
+
+	switch (reason)
+	{
+	case CLUSTER_KILL_REJECTED:
+		return "our membership application was rejected";
+
+	case CLUSTER_KILL_CMANTOOL:
+		return "we were killed by cman_tool or other application";
+
+	case CLUSTER_KILL_REJOIN:
+		return "we node rejoined cluster without a full restart";
+
+	default:
+		sprintf(msg, "we got kill message number %d", reason);
+		return msg;
+	}
+}



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-17 11:00 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-01-17 11:00 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-01-17 11:00:41

Modified files:
	cman/daemon    : commands.c 

Log message:
	If we get killed by another node then print the reason in English rather
	than just a number.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.59&r2=1.60

--- cluster/cman/daemon/commands.c	2007/01/16 09:54:43	1.59
+++ cluster/cman/daemon/commands.c	2007/01/17 11:00:40	1.60
@@ -2,7 +2,7 @@
 *******************************************************************************
 **
 **  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-**  Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
+**  Copyright (C) 2004-2007 Red Hat, Inc.  All rights reserved.
 **
 **  This copyrighted material is made available to anyone wishing to use,
 **  modify, copy, or redistribute it subject to the terms and conditions
@@ -97,6 +97,7 @@
 static void process_internal_message(char *data, int len, int nodeid, int byteswap);
 static void recalculate_quorum(int allow_decrease);
 static void send_kill(int nodeid, uint16_t reason);
+static char *killmsg_reason(int reason);
 
 static void set_port_bit(struct cluster_node *node, uint8_t port)
 {
@@ -1817,7 +1818,8 @@
 		killmsg = (struct cl_killmsg *)data;
 		P_MEMB("got KILL for node %d\n", killmsg->nodeid);
 		if (killmsg->nodeid == wanted_nodeid) {
-			log_msg(LOG_INFO, "cman killed by node %d for reason %d\n", nodeid, killmsg->reason);
+			log_msg(LOG_INFO, "cman killed by node %d because %s\n", nodeid,
+				killmsg_reason(killmsg->reason));
 			exit(1);
 		}
 		break;
@@ -2040,3 +2042,23 @@
 	return NULL;
 }
 
+static char *killmsg_reason(int reason)
+{
+	static char msg[1024];
+
+	switch (reason)
+	{
+	case CLUSTER_KILL_REJECTED:
+		return "our membership application was rejected";
+
+	case CLUSTER_KILL_CMANTOOL:
+		return "we were killed by cman_tool or other application";
+
+	case CLUSTER_KILL_REJOIN:
+		return "we node rejoined cluster without a full restart";
+
+	default:
+		sprintf(msg, "we got kill message number %d", reason);
+		return msg;
+	}
+}



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-16 16:31 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-01-16 16:31 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL50
Changes by:	pcaulfield at sourceware.org	2007-01-16 16:31:08

Modified files:
	cman/daemon    : commands.c 

Log message:
	Don't return to 'cman_tool leave' until we are just about to quit.
	Otherwise there can be a delay between cman_tool thinking that we
	are down, and the node really being out of the cluster.
	see bz#222686

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.55.4.1&r2=1.55.4.2

--- cluster/cman/daemon/commands.c	2006/12/13 14:20:50	1.55.4.1
+++ cluster/cman/daemon/commands.c	2007/01/16 16:31:07	1.55.4.2
@@ -869,13 +869,13 @@
 		}
 		else {
 			reply = -EBUSY;
+
+			/* Tell originator that shutdown was cancelled */
+			send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, reply);
+			shutdown_con = NULL;
 		}
 
 		P_MEMB("shutdown decision is: %d (yes=%d, no=%d) flags=%x\n", reply, shutdown_yes, shutdown_no, shutdown_flags);
-
-		/* Tell originator what we decided */
-		send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, reply);
-		shutdown_con = NULL;
 	}
 }
 
@@ -1827,8 +1827,12 @@
 		P_MEMB("got LEAVE from node %d, reason = %d\n", nodeid, leavemsg->reason);
 
 		/* We got our own leave message back. now quit */
-		if (node && node->node_id == us->node_id)
+		if (node && node->node_id == us->node_id) {
+			/* Tell whomever asked us to leave that we are now going down */
+			if (shutdown_con)
+				send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, 0);
 			exit(0);
+		}
 
 		/* Someone else, make a note of the reason for leaving */
 		if (node)



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-16  9:57 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-01-16  9:57 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2007-01-16 09:57:21

Modified files:
	cman/daemon    : commands.c 

Log message:
	Don't return to 'cman_tool leave' until we are just about to quit.
	Otherwise there can be a delay between cman_tool thinking that we
	are down, and the node really being out of the cluster.
	see bz#222686

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.3&r2=1.55.2.4

--- cluster/cman/daemon/commands.c	2007/01/09 13:32:08	1.55.2.3
+++ cluster/cman/daemon/commands.c	2007/01/16 09:57:20	1.55.2.4
@@ -869,13 +869,13 @@
 		}
 		else {
 			reply = -EBUSY;
+
+			/* Tell originator that shutdown was cancelled */
+			send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, reply);
+			shutdown_con = NULL;
 		}
 
 		P_MEMB("shutdown decision is: %d (yes=%d, no=%d) flags=%x\n", reply, shutdown_yes, shutdown_no, shutdown_flags);
-
-		/* Tell originator what we decided */
-		send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, reply);
-		shutdown_con = NULL;
 	}
 }
 
@@ -1827,8 +1827,12 @@
 		P_MEMB("got LEAVE from node %d, reason = %d\n", nodeid, leavemsg->reason);
 
 		/* We got our own leave message back. now quit */
-		if (node && node->node_id == us->node_id)
+		if (node && node->node_id == us->node_id) {
+			/* Tell whomever asked us to leave that we are now going down */
+			if (shutdown_con)
+				send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, 0);
 			exit(0);
+		}
 
 		/* Someone else, make a note of the reason for leaving */
 		if (node)



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-16  9:54 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-01-16  9:54 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-01-16 09:54:43

Modified files:
	cman/daemon    : commands.c 

Log message:
	Don't return to 'cman_tool leave' until we are just about to quit.
	Otherwise there can be a delay between cman_tool thinking that we
	are down, and the node really being out of the cluster.
	see bz#222686

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.58&r2=1.59

--- cluster/cman/daemon/commands.c	2007/01/09 13:31:23	1.58
+++ cluster/cman/daemon/commands.c	2007/01/16 09:54:43	1.59
@@ -869,13 +869,13 @@
 		}
 		else {
 			reply = -EBUSY;
+
+			/* Tell originator that shutdown was cancelled */
+			send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, reply);
+			shutdown_con = NULL;
 		}
 
 		P_MEMB("shutdown decision is: %d (yes=%d, no=%d) flags=%x\n", reply, shutdown_yes, shutdown_no, shutdown_flags);
-
-		/* Tell originator what we decided */
-		send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, reply);
-		shutdown_con = NULL;
 	}
 }
 
@@ -1827,8 +1827,12 @@
 		P_MEMB("got LEAVE from node %d, reason = %d\n", nodeid, leavemsg->reason);
 
 		/* We got our own leave message back. now quit */
-		if (node && node->node_id == us->node_id)
+		if (node && node->node_id == us->node_id) {
+			/* Tell whomever asked us to leave that we are now going down */
+			if (shutdown_con)
+				send_status_return(shutdown_con, CMAN_CMD_TRY_SHUTDOWN, 0);
 			exit(0);
+		}
 
 		/* Someone else, make a note of the reason for leaving */
 		if (node)



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-09 13:32 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-01-09 13:32 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2007-01-09 13:32:08

Modified files:
	cman/daemon    : commands.c 

Log message:
	quorumdev_poll is in milliseconds, not seconds!
	Thanks to Simone Gotti

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.2&r2=1.55.2.3

--- cluster/cman/daemon/commands.c	2007/01/08 10:16:37	1.55.2.2
+++ cluster/cman/daemon/commands.c	2007/01/09 13:32:08	1.55.2.3
@@ -1042,7 +1042,7 @@
 		return;
 
 	gettimeofday(&now, NULL);
-	if (quorum_device->last_hello.tv_sec + quorumdev_poll < now.tv_sec) {
+	if (quorum_device->last_hello.tv_sec + quorumdev_poll/1000 < now.tv_sec) {
 		quorum_device->state = NODESTATE_DEAD;
 		log_msg(LOG_INFO, "lost contact with quorum device\n");
 		recalculate_quorum(0);



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-09 13:31 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-01-09 13:31 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-01-09 13:31:23

Modified files:
	cman/daemon    : commands.c 

Log message:
	quorumdev_poll is in milliseconds, not seconds!
	Thanks to Simone Gotti

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.57&r2=1.58

--- cluster/cman/daemon/commands.c	2007/01/08 10:16:17	1.57
+++ cluster/cman/daemon/commands.c	2007/01/09 13:31:23	1.58
@@ -1042,7 +1042,7 @@
 		return;
 
 	gettimeofday(&now, NULL);
-	if (quorum_device->last_hello.tv_sec + quorumdev_poll < now.tv_sec) {
+	if (quorum_device->last_hello.tv_sec + quorumdev_poll/1000 < now.tv_sec) {
 		quorum_device->state = NODESTATE_DEAD;
 		log_msg(LOG_INFO, "lost contact with quorum device\n");
 		recalculate_quorum(0);



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-08 10:16 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-01-08 10:16 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2007-01-08 10:16:37

Modified files:
	cman/daemon    : commands.c 

Log message:
	Don't lose NUL on the end of the fence-agent.
	thanks to Simone Gotti <simone.gotti@email.it> for the patch

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55.2.1&r2=1.55.2.2

--- cluster/cman/daemon/commands.c	2006/12/13 13:39:43	1.55.2.1
+++ cluster/cman/daemon/commands.c	2007/01/08 10:16:37	1.55.2.2
@@ -1088,7 +1088,7 @@
 {
 	struct cl_fence_info *f = (struct cl_fence_info *)cmdbuf;
 	struct cluster_node *node;
-	char msg[sizeof(struct cl_fencemsg)+strlen(f->fence_agent)];
+	char msg[sizeof(struct cl_fencemsg)+strlen(f->fence_agent)+1];
 	struct cl_fencemsg *fence_msg = (struct cl_fencemsg *)msg;
 
 	node = find_node_by_nodeid(f->nodeid);
@@ -1749,7 +1749,7 @@
 	if (node->fence_time && !msg->fence_time &&
 	    node->fence_agent && !msg->fence_agent[0])
 	{
-		char msg[sizeof(struct cl_fencemsg)+strlen(node->fence_agent)];
+		char msg[sizeof(struct cl_fencemsg)+strlen(node->fence_agent)+1];
 		struct cl_fencemsg *fence_msg = (struct cl_fencemsg *)msg;
 
 		fence_msg->cmd = CLUSTER_MSG_FENCESTATUS;



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2007-01-08 10:16 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2007-01-08 10:16 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2007-01-08 10:16:17

Modified files:
	cman/daemon    : commands.c 

Log message:
	Don't lose NUL on the end of the fence-agent.
	thanks to Simone Gotti <simone.gotti@email.it> for the patch

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.56&r2=1.57

--- cluster/cman/daemon/commands.c	2006/12/13 13:38:11	1.56
+++ cluster/cman/daemon/commands.c	2007/01/08 10:16:17	1.57
@@ -1088,7 +1088,7 @@
 {
 	struct cl_fence_info *f = (struct cl_fence_info *)cmdbuf;
 	struct cluster_node *node;
-	char msg[sizeof(struct cl_fencemsg)+strlen(f->fence_agent)];
+	char msg[sizeof(struct cl_fencemsg)+strlen(f->fence_agent)+1];
 	struct cl_fencemsg *fence_msg = (struct cl_fencemsg *)msg;
 
 	node = find_node_by_nodeid(f->nodeid);
@@ -1749,7 +1749,7 @@
 	if (node->fence_time && !msg->fence_time &&
 	    node->fence_agent && !msg->fence_agent[0])
 	{
-		char msg[sizeof(struct cl_fencemsg)+strlen(node->fence_agent)];
+		char msg[sizeof(struct cl_fencemsg)+strlen(node->fence_agent)+1];
 		struct cl_fencemsg *fence_msg = (struct cl_fencemsg *)msg;
 
 		fence_msg->cmd = CLUSTER_MSG_FENCESTATUS;



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2006-12-13 14:20 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2006-12-13 14:20 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL50
Changes by:	pcaulfield at sourceware.org	2006-12-13 14:20:50

Modified files:
	cman/daemon    : commands.c 

Log message:
	Fix typo that could affect shutdown
	bz#219385

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.55&r2=1.55.4.1

--- cluster/cman/daemon/commands.c	2006/11/06 10:06:14	1.55
+++ cluster/cman/daemon/commands.c	2006/12/13 14:20:50	1.55.4.1
@@ -1428,7 +1428,7 @@
 	   then we take its closedown as a "Yes" to the "can we shutdown"
 	   question. If it previously answered "No", we need to change its vote */
 	if (shutdown_con && con->events) {
-		if (!con->shutdown_reply) {
+		if (con->shutdown_reply) {
 			if (con->shutdown_reply == SHUTDOWN_REPLY_YES)
 				shutdown_yes--;
 			if (con->shutdown_reply == SHUTDOWN_REPLY_NO)



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2006-12-13 13:39 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2006-12-13 13:39 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	pcaulfield at sourceware.org	2006-12-13 13:39:43

Modified files:
	cman/daemon    : commands.c 

Log message:
	Fix typo that could affect shutdown
	bz#219385

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.55&r2=1.55.2.1

--- cluster/cman/daemon/commands.c	2006/11/06 10:06:14	1.55
+++ cluster/cman/daemon/commands.c	2006/12/13 13:39:43	1.55.2.1
@@ -1428,7 +1428,7 @@
 	   then we take its closedown as a "Yes" to the "can we shutdown"
 	   question. If it previously answered "No", we need to change its vote */
 	if (shutdown_con && con->events) {
-		if (!con->shutdown_reply) {
+		if (con->shutdown_reply) {
 			if (con->shutdown_reply == SHUTDOWN_REPLY_YES)
 				shutdown_yes--;
 			if (con->shutdown_reply == SHUTDOWN_REPLY_NO)



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2006-12-13 13:38 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2006-12-13 13:38 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2006-12-13 13:38:12

Modified files:
	cman/daemon    : commands.c 

Log message:
	Fix typo that could affect shutdown.
	see bz#219385

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.55&r2=1.56

--- cluster/cman/daemon/commands.c	2006/11/06 10:06:14	1.55
+++ cluster/cman/daemon/commands.c	2006/12/13 13:38:11	1.56
@@ -1428,7 +1428,7 @@
 	   then we take its closedown as a "Yes" to the "can we shutdown"
 	   question. If it previously answered "No", we need to change its vote */
 	if (shutdown_con && con->events) {
-		if (!con->shutdown_reply) {
+		if (con->shutdown_reply) {
 			if (con->shutdown_reply == SHUTDOWN_REPLY_YES)
 				shutdown_yes--;
 			if (con->shutdown_reply == SHUTDOWN_REPLY_NO)



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2006-11-06 10:06 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2006-11-06 10:06 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2006-11-06 10:06:14

Modified files:
	cman/daemon    : commands.c 

Log message:
	if an AISONLY node dies, mark it DEAD
	bz#213747 comments 9-13 (ish)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.54&r2=1.55

--- cluster/cman/daemon/commands.c	2006/11/03 15:07:52	1.54
+++ cluster/cman/daemon/commands.c	2006/11/06 10:06:14	1.55
@@ -1961,13 +1961,18 @@
 	node->flags &= ~NODE_FLAGS_FENCEDWHILEUP;
 	node->flags |= NODE_FLAGS_BEENDOWN;
 
-	if (node->state == NODESTATE_MEMBER) {
+	switch (node->state) {
+	case NODESTATE_MEMBER:
 		node->state = NODESTATE_DEAD;
 		cluster_members--;
 		recalculate_quorum(0);
-		return;
-	}
-	if (node->state == NODESTATE_LEAVING) {
+		break;
+
+	case NODESTATE_AISONLY:
+		node->state = NODESTATE_DEAD;
+		break;
+
+	case NODESTATE_LEAVING:
 		node->state = NODESTATE_DEAD;
 		cluster_members--;
 
@@ -1975,6 +1980,11 @@
 			recalculate_quorum(1);
 		else
 			recalculate_quorum(0);
+		break;
+
+	case NODESTATE_JOINING:
+	case NODESTATE_DEAD:
+		break;
 	}
 }
 



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2006-10-16 14:10 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2006-10-16 14:10 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2006-10-16 14:10:21

Modified files:
	cman/daemon    : commands.c 

Log message:
	Sigh, got the condition back-to-front.
	This should fix the AISONLY status (again).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.52&r2=1.53

--- cluster/cman/daemon/commands.c	2006/10/10 15:14:53	1.52
+++ cluster/cman/daemon/commands.c	2006/10/16 14:10:21	1.53
@@ -1682,9 +1682,8 @@
         /* This is the killer. If the join_time of the node matches that already stored AND
 	   the node has been down, then we kill it as this must be a rejoin */
 	if (msg->join_time == node->cman_join_time && node->flags & NODE_FLAGS_BEENDOWN) {
-
 		/* Don't duplicate messages */
-		if (node->state == NODESTATE_AISONLY) {
+		if (node->state != NODESTATE_AISONLY) {
 			if (cluster_is_quorate) {
 				P_MEMB("Killing node %s because it has rejoined the cluster without cman_tool join", node->name);
 				log_printf(LOG_CRIT, "Killing node %s because it has rejoined the cluster without cman_tool join", node->name);



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2006-10-10 15:14 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2006-10-10 15:14 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2006-10-10 15:14:53

Modified files:
	cman/daemon    : commands.c 

Log message:
	Avoid spurious messages. and also fix an odd node count when nodes
	rejoin.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.51&r2=1.52

--- cluster/cman/daemon/commands.c	2006/10/05 07:48:33	1.51
+++ cluster/cman/daemon/commands.c	2006/10/10 15:14:53	1.52
@@ -1682,15 +1682,20 @@
         /* This is the killer. If the join_time of the node matches that already stored AND
 	   the node has been down, then we kill it as this must be a rejoin */
 	if (msg->join_time == node->cman_join_time && node->flags & NODE_FLAGS_BEENDOWN) {
-		if (cluster_is_quorate) {
-			P_MEMB("Killing node %s because it has rejoined the cluster without cman_tool join", node->name);
-			log_printf(LOG_CRIT, "Killing node %s because it has rejoined the cluster without cman_tool join", node->name);
-			send_kill(nodeid, CLUSTER_KILL_REJOIN);
-		}
-		else {
-			P_MEMB("Node %s not joined to cman because it has rejoined an inquorate cluster", node->name);
-			log_printf(LOG_CRIT, "Node %s not joined to cman because it has rejoined an inquorate cluster", node->name);
-			node->state = NODESTATE_AISONLY;
+
+		/* Don't duplicate messages */
+		if (node->state == NODESTATE_AISONLY) {
+			if (cluster_is_quorate) {
+				P_MEMB("Killing node %s because it has rejoined the cluster without cman_tool join", node->name);
+				log_printf(LOG_CRIT, "Killing node %s because it has rejoined the cluster without cman_tool join", node->name);
+				node->state = NODESTATE_AISONLY;
+				send_kill(nodeid, CLUSTER_KILL_REJOIN);
+			}
+			else {
+				P_MEMB("Node %s not joined to cman because it has rejoined an inquorate cluster", node->name);
+				log_printf(LOG_CRIT, "Node %s not joined to cman because it has rejoined an inquorate cluster", node->name);
+				node->state = NODESTATE_AISONLY;
+			}
 		}
 		return;
 	}



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [Cluster-devel] cluster/cman/daemon commands.c
@ 2006-09-12 12:45 pcaulfield
  0 siblings, 0 replies; 35+ messages in thread
From: pcaulfield @ 2006-09-12 12:45 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	pcaulfield at sourceware.org	2006-09-12 12:45:52

Modified files:
	cman/daemon    : commands.c 

Log message:
	Fix strdup braindamage that probably caused segfaults when nodes
	left the cluster.
	
	This is likely to be the cause of bz#206083
	(thanks to Steven Dake for most of the diagnostics on this).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/daemon/commands.c.diff?cvsroot=cluster&r1=1.48&r2=1.49

--- cluster/cman/daemon/commands.c	2006/08/17 13:22:39	1.48
+++ cluster/cman/daemon/commands.c	2006/09/12 12:45:52	1.49
@@ -1644,7 +1644,7 @@
 	if (node->fence_agent && msg->fence_agent[0] && strcmp(node->fence_agent, msg->fence_agent))
 	{
 		free(node->fence_agent);
-		strdup(node->fence_agent);
+		node->fence_agent = strdup(msg->fence_agent);
 		node->fence_time = msg->fence_time;
 	}
 



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

end of thread, other threads:[~2008-02-04 10:54 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-02 16:23 [Cluster-devel] cluster/cman/daemon commands.c pcaulfield
  -- strict thread matches above, loose matches on Subject: below --
2008-02-04 10:54 pcaulfield
2008-01-03 16:36 pcaulfield
2008-01-03 16:35 pcaulfield
2008-01-03 20:40 ` Fabio M. Di Nitto
2008-01-03  6:48 fabbione
2008-01-02 10:02 pcaulfield
2008-01-02  9:27 pcaulfield
2007-11-26 17:03 lhh
2007-11-20  9:21 pcaulfield
2007-11-20  9:02 pcaulfield
2007-09-27  9:05 pcaulfield
2007-09-27  9:01 pcaulfield
2007-09-17 13:35 pcaulfield
2007-09-07 12:17 pcaulfield
2007-08-22  7:05 pcaulfield
2007-01-17 15:02 pcaulfield
2007-01-17 15:02 pcaulfield
2007-01-17 11:01 pcaulfield
2007-01-17 14:50 ` Robert Peterson
2007-01-17 11:00 pcaulfield
2007-01-16 16:31 pcaulfield
2007-01-16  9:57 pcaulfield
2007-01-16  9:54 pcaulfield
2007-01-09 13:32 pcaulfield
2007-01-09 13:31 pcaulfield
2007-01-08 10:16 pcaulfield
2007-01-08 10:16 pcaulfield
2006-12-13 14:20 pcaulfield
2006-12-13 13:39 pcaulfield
2006-12-13 13:38 pcaulfield
2006-11-06 10:06 pcaulfield
2006-10-16 14:10 pcaulfield
2006-10-10 15:14 pcaulfield
2006-09-12 12:45 pcaulfield

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 NNTP newsgroup(s).