All of lore.kernel.org
 help / color / mirror / Atom feed
From: jbrassow@sourceware.org <jbrassow@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Cluster Project branch, RHEL4, updated. gfs-kernel_2_6_9_76-30-g625364c
Date: 8 Apr 2008 19:35:13 -0000	[thread overview]
Message-ID: <20080408193513.14535.qmail@sourceware.org> (raw)

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=625364c99277445b97bbb3120736c358b802fb0f

The branch, RHEL4 has been updated
       via  625364c99277445b97bbb3120736c358b802fb0f (commit)
      from  aac75cba36115a59a489c0b1a52be5259f54fb87 (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 625364c99277445b97bbb3120736c358b802fb0f
Author: Jonathan Brassow <jbrassow@redhat.com>
Date:   Mon Apr 7 10:48:24 2008 -0500

    - dm-cmirror.ko: Fix infinite election loop (bug 217895)
    
    It was possible for an election to be run just before
    a machine that was next in line to be server suspened.
    
    This would cause the remaining nodes to think a suspended
    node was the active server - worse, the suspended node
    would allow itself to become server and then say in was
    not in charge of the log.  This would simply keep going
    round and round.
    
    Fix is to increment 'suspended' before exiting postsuspend,
    and not allowing a node to be elected server if 'suspended'
    was set.

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

Summary of changes:
 cmirror-kernel/src/dm-cmirror-client.c |    1 +
 cmirror-kernel/src/dm-cmirror-server.c |   13 +++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/cmirror-kernel/src/dm-cmirror-client.c b/cmirror-kernel/src/dm-cmirror-client.c
index c11cedc..43fe5ef 100644
--- a/cmirror-kernel/src/dm-cmirror-client.c
+++ b/cmirror-kernel/src/dm-cmirror-client.c
@@ -836,6 +836,7 @@ static int cluster_postsuspend(struct dirty_log *log)
 			}
 		}
 	}
+	atomic_set(&lc->suspended, 2);
 
 	return 0;
 }
diff --git a/cmirror-kernel/src/dm-cmirror-server.c b/cmirror-kernel/src/dm-cmirror-server.c
index 4252058..c8f77ea 100644
--- a/cmirror-kernel/src/dm-cmirror-server.c
+++ b/cmirror-kernel/src/dm-cmirror-server.c
@@ -939,10 +939,19 @@ static int process_election(struct log_request *lr, struct log_c *lc,
 	if((lc->server_id == my_id) && !atomic_read(&lc->suspended)){
 	*/
 	if (lc->server_id == my_id) {
-		if (atomic_read(&lc->suspended)) {
-			DMDEBUG("I'm suspended, but still responding as server: %s",
+		int r = atomic_read(&lc->suspended);
+
+		if (r >= 2) {
+			DMDEBUG("I am the assigned server while suspended: %s",
 				lc->uuid + (strlen(lc->uuid) - 8));
+			lc->server_id = 0xDEAD;
+			lr->u.lr_node_count++;
+			return 0;
 		}
+
+		if (r == 1)
+			DMDEBUG("I'm suspended, but still responding as server: %s",
+				lc->uuid + (strlen(lc->uuid) - 8));
 		lr->u.lr_coordinator = my_id;
 		if(!(saddr->sin_addr.s_addr = nodeid_to_ipaddr(lr->u.lr_starter))){
 			return -1;


hooks/post-receive
--
Cluster Project



                 reply	other threads:[~2008-04-08 19:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080408193513.14535.qmail@sourceware.org \
    --to=jbrassow@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.