[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] Cluster Project branch, RHEL46, updated. cman-kernel_2_6_9_54-14-g9584b15



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=9584b1543b076502522a30ce1bae6c7e1eb68aa0

The branch, RHEL46 has been updated
       via  9584b1543b076502522a30ce1bae6c7e1eb68aa0 (commit)
      from  1728dd23f74b9d01df5146e9b405c3149b896bc7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9584b1543b076502522a30ce1bae6c7e1eb68aa0
Author: Christine Caulfield <ccaulfie redhat com>
Date:   Fri May 23 08:30:12 2008 +0100

    [CMAN] Update to 4.7
    
    This commit updates the 4.6 cman kernel to the same code as 4.6.
    
    The main purpose of this is to fix bz#447955 which really needs
    all the ack-handling code as well as the actual fix for the
    bug mentioned.
    
    Signed-off-by: Christine Caulfield <ccaulfie redhat com>

-----------------------------------------------------------------------

Summary of changes:
 cman-kernel/src/cnxman.c     |    6 +++---
 cman-kernel/src/membership.c |   26 ++++++++++++++++++++------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/cman-kernel/src/cnxman.c b/cman-kernel/src/cnxman.c
index 8de38d6..f754ef1 100644
--- a/cman-kernel/src/cnxman.c
+++ b/cman-kernel/src/cnxman.c
@@ -867,10 +867,10 @@ static void process_incoming_packet(struct cl_comms_socket *csock,
         /* Have we received this message before ? If so just ignore it, it's a
 	 * resend for someone else's benefit */
 	if (!(flags & MSG_NOACK) &&
-	    rem_node && rem_node->last_seq_recv &&
+	    rem_node && rem_node->last_ackneeded_seq_recv &&
 	    (short)((short)le16_to_cpu(header->seq) - (short)rem_node->last_ackneeded_seq_recv) <= 0) {
-		P_COMMS("Discarding message -  seq = %d, last_seen = %d\n",
-			header->seq, rem_node->last_seq_recv);
+		P_COMMS("Discarding message -  seq = %d, last_seen = %d, last_acked_seen = %d\n",
+			header->seq, rem_node->last_seq_recv, rem_node->last_ackneeded_seq_recv);
 		/* Still need to ACK it though, in case it was the ACK that got
 		 * lost */
 		cl_sendack(csock, header->seq, addrlen, addr, header->tgtport, 0);
diff --git a/cman-kernel/src/membership.c b/cman-kernel/src/membership.c
index 5ce3a6b..d1712ce 100644
--- a/cman-kernel/src/membership.c
+++ b/cman-kernel/src/membership.c
@@ -76,6 +76,7 @@ static int sizeof_members_array;	/* Can dynamically increase (vmalloc
 static struct cluster_node **members_by_nodeid;
 
 #define MEMBER_INCREMENT_SIZE 10
+#define NON_ACKABLE_HELLO_COUNT 100
 
 static int votes = 1;		/* Votes this node has */
 static int expected_votes = 1;	/* Total expected votes in the cluster */
@@ -127,7 +128,7 @@ static int send_cluster_view(unsigned char cmd, struct sockaddr_cl *saddr,
 			     unsigned int flags, unsigned int flags2);
 static int send_joinreq(struct sockaddr_cl *addr, int addr_len);
 static int send_startack(struct sockaddr_cl *addr, int addr_len);
-static int send_hello(void);
+static int send_hello(int ackable);
 static int send_master_hello(void);
 static int send_newcluster(void);
 static int end_transition(void);
@@ -315,7 +316,7 @@ static int hello_kthread(void *unused)
 		set_task_state(current, TASK_RUNNING);
 
 		if (node_state != REJECTED && node_state != LEFT_CLUSTER)
-			send_hello();
+			send_hello(1);
 	}
 	if (timer_pending(&hello_timer))
 		del_timer(&hello_timer);
@@ -597,7 +598,7 @@ static void form_cluster(void)
 		set_nodeid(us, 1);
 	recalculate_quorum(0);
 	sm_member_update(cluster_is_quorate);
-	send_hello();
+	send_hello(0);
 	kernel_thread(hello_kthread, NULL, 0);
 }
 
@@ -821,19 +822,29 @@ static int send_newcluster()
 			   MSG_NOACK);
 }
 
-static int send_hello()
+static int send_hello(int ackable)
 {
 	struct cl_mem_hello_msg hello_msg;
 	int status;
+	static int last_ackable = 0;
+	int flags;
 
 	hello_msg.cmd = CLUSTER_MEM_HELLO;
 	hello_msg.members = cpu_to_le16(cluster_members);
 	hello_msg.flags = cluster_is_quorate ? HELLO_FLAG_QUORATE : 0;
 	hello_msg.generation = cpu_to_le32(cluster_generation);
 
+	/* Every so often we need request an ACK for a HELLO message
+	   to keep the messaging system sane */
+	if (ackable && !(++last_ackable % NON_ACKABLE_HELLO_COUNT)) {
+		flags = MSG_ALLINT;
+	}
+	else {
+		flags = MSG_NOACK | MSG_ALLINT;
+	}
 	status = kcl_sendmsg(mem_socket, &hello_msg,
 			     sizeof(struct cl_mem_hello_msg),
-			     NULL, 0, MSG_NOACK | MSG_ALLINT);
+			     NULL, 0, flags);
 
 	last_hello = jiffies;
 
@@ -1398,6 +1409,7 @@ void a_node_just_died(struct cluster_node *node)
 		cluster_members--;
 	node->state = NODESTATE_DEAD;
 	node->last_seq_recv = 0;
+	node->last_ackneeded_seq_recv = 0;
 	up(&cluster_members_lock);
 
 	send_nodedown(node->node_id, node->leave_reason);
@@ -1683,6 +1695,7 @@ static struct cluster_node *add_new_node(char *name, unsigned char votes,
 		newnode->us = 0;
 		newnode->leave_reason = 0;
 		newnode->last_seq_recv = 0;
+		newnode->last_ackneeded_seq_recv = 0;
 		newnode->last_seq_acked = 0;
 		newnode->last_seq_sent = 0;
 		newnode->incarnation++;
@@ -1717,6 +1730,7 @@ static struct cluster_node *add_new_node(char *name, unsigned char votes,
 	newnode->us = 0;
 	newnode->leave_reason = 0;
 	newnode->last_seq_recv = 0;
+	newnode->last_ackneeded_seq_recv = 0;
 	newnode->last_seq_acked = 0;
 	newnode->last_seq_sent = 0;
 	newnode->incarnation = 0;
@@ -2620,7 +2634,7 @@ static int do_process_newcluster(struct msghdr *msg, char *buf, int len)
 	}
 
 	if (node_state == MEMBER)
-		send_hello();
+		send_hello(0);
 
 	return 0;
 }


hooks/post-receive
--
Cluster Project


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]