public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* Cluster Project branch, RHEL4, updated. gfs-kernel_2_6_9_76-30-g625364c
@ 2008-04-08 19:35 jbrassow
  0 siblings, 0 replies; only message in thread
From: jbrassow @ 2008-04-08 19:35 UTC (permalink / raw)
  To: cluster-cvs, cluster-devel

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


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

only message in thread, other threads:[~2008-04-08 19:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-08 19:35 Cluster Project branch, RHEL4, updated. gfs-kernel_2_6_9_76-30-g625364c jbrassow

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).