public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL47 - Make every 100 Hello messages require an ACK. This keeps the ackneeded sequence
@ 2009-06-19 16:48 Chris Feist
  0 siblings, 0 replies; only message in thread
From: Chris Feist @ 2009-06-19 16:48 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a3a98947a6a289d95f95c143132a3b9054d57b2e
Commit:        a3a98947a6a289d95f95c143132a3b9054d57b2e
Parent:        2dd6dabff89be06096d60a8f2400bbec9f351e98
Author:        Christine Caulfield <ccaulfie@redhat.com>
AuthorDate:    Tue May 13 16:37:11 2008 +0100
Committer:     Chris Feist <cfeist@redhat.com>
CommitterDate: Fri Jun 19 11:45:28 2009 -0500

Make every 100 Hello messages require an ACK. This keeps the ackneeded sequence

numbers close to the actual sequence numbers, so that the comparisions don't
fail if there has been no cman messages sent for a while.

bz#444751

4.7.z bz#495707
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
---
 cman-kernel/src/membership.c |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/cman-kernel/src/membership.c b/cman-kernel/src/membership.c
index 7166f56..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;
 
@@ -2623,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;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-19 16:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-19 16:48 cluster: RHEL47 - Make every 100 Hello messages require an ACK. This keeps the ackneeded sequence Chris Feist

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 read-only IMAP folder(s) and NNTP newsgroup(s).