From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21809 invoked by alias); 19 Jun 2009 16:48:14 -0000 Received: (qmail 21803 invoked by alias); 19 Jun 2009 16:48:13 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_HELO_PASS X-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: RHEL47 - Make every 100 Hello messages require an ACK. This keeps the ackneeded sequence To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL47 X-Git-Reftype: branch X-Git-Oldrev: 2dd6dabff89be06096d60a8f2400bbec9f351e98 X-Git-Newrev: a3a98947a6a289d95f95c143132a3b9054d57b2e From: Chris Feist Message-Id: <20090619164743.143E61201D2@lists.fedorahosted.org> Date: Fri, 19 Jun 2009 16:48:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00567.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a3a98947a6a289d95f95c143132a3b9054d57b2e Commit: a3a98947a6a289d95f95c143132a3b9054d57b2e Parent: 2dd6dabff89be06096d60a8f2400bbec9f351e98 Author: Christine Caulfield AuthorDate: Tue May 13 16:37:11 2008 +0100 Committer: Chris Feist 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 --- 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; }