[OpenAFS-devel] Patch to correct problems with ubik quorum election

Nathan Neulinger nneul@umr.edu
Tue, 3 Apr 2001 12:31:56 -0500


--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

This fixes the problem with ubik_host/ubik_host[0] and also corrects a 
debug line to output the host address in the right byte order.

Without this, my DB servers would sit in election forever. 

-- Nathan

------------------------------------------------------------
Nathan Neulinger                       EMail:  nneul@umr.edu
University of Missouri - Rolla         Phone: (573) 341-4841
Computing Services                       Fax: (573) 341-4216

--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="fix-voting.diff"

Index: vote.c
===================================================================
RCS file: /cvs/openafs/src/ubik/vote.c,v
retrieving revision 1.3
diff -u -r1.3 vote.c
--- vote.c	2001/02/12 21:57:58	1.3
+++ vote.c	2001/04/03 17:30:07
@@ -236,7 +236,7 @@
        he's lowest, these loops don't occur.  because if someone knows he's
        lowest, he will send out beacons telling others to vote for him. */
     if (!amIClone &&
-        (ntohl((afs_uint32) ubik_host) <= ntohl((afs_uint32) lowestHost)
+        (ntohl((afs_uint32) ubik_host[0]) <= ntohl((afs_uint32) lowestHost)
         || lowestTime + BIGTIME < now)) {
 	lowestTime = now;
 	lowestHost = ubik_host[0];
@@ -294,9 +294,8 @@
 	    (otherHost != lastYesHost) ||
 	    (lastYesState != astate)) {
 	   /* A new vote or a change in the vote or changed quorum */
-	   ubik_dprint("Ubik: vote 'yes' for %d.%d.%d.%d %s\n",
-		       ((otherHost>>24)&0xff), ((otherHost>>16)&0xff),
-		       ((otherHost>> 8)&0xff), (otherHost      &0xff),
+	   ubik_dprint("Ubik: vote 'yes' for %s %s\n",
+				afs_inet_ntoa(otherHost),
 		       (astate?"(in quorum)":"(NOT in quorum)"));
 	}
 

--mYCpIKhGyMATD0i+--