udebug

Assar Westerlund assar at stacken.kth.se
Mon Mar 20 01:49:48 CET 2000


Dr A V Le Blanc <LeBlanc at mcc.ac.uk> writes:
> Hm, I see the seconds produced by my patch are a mess; Oh, well,
> it was worth a try.

I get the same result with Transarc udebug against a non-sync site.  I
don't think you are supposed to do SDebug.  What about just sending
the SDebug rpcs to the sync server if it's different?  I did a small
modification to your patch and it seems to work fine.

Can you have a look at it and verify it?  If it's ok, I'll commit it.

/assar

Index: udebug.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/appl/udebug/udebug.c,v
retrieving revision 1.10
diff -u -w -u -w -r1.10 udebug.c
--- udebug.c	2000/03/19 13:36:15	1.10
+++ udebug.c	2000/03/20 00:48:39
@@ -39,12 +39,14 @@
 #include "appl_locl.h"
 RCSID("$Id: udebug.c,v 1.10 2000/03/19 13:36:15 lha Exp $");
 
+static int verbose = 0;
+
 static void
 usage(void)
 {
     fprintf(stderr,  
 	    "udebug: Version $Id: udebug.c,v 1.10 2000/03/19 13:36:15 lha Exp $\n"
-	    "usage: udebug -servers server ... -port port -noauth\n");
+	    "usage: udebug -servers server ... -port port -noauth -long\n");
     exit(1);
 }
 
@@ -150,12 +152,19 @@
 	       db.anyReadLocks + db.anyWriteLocks, db.anyWriteLocks);
 	
 	if (db.amSyncSite) {
-	    int i;
-	    ubik_sdebug sdb;
 
 	    printf("I'm the synchost for %d seconds more (%s)\n",
 		   db.syncSiteUntil - db.now, 
 		   myctime(db.syncSiteUntil));
+	} else {
+	    server.s_addr = htonl(db.syncHost);
+	    printf("I'm not the synchost, but %s is.\n",
+		   inet_ntoa(server));    
+	}
+
+	if (verbose || db.amSyncSite) {
+	    int i;
+	    ubik_sdebug sdb;
 
 	    printf("Recover state is 0x%x\n", db.recoveryState);
 	    printf("Last time a new db version was laballed was:\n"
@@ -163,6 +172,16 @@
 		   ABS_COMP_DB(db,epochTime),
 		   myctime(db.epochTime));
 
+	    if (!db.amSyncSite) {
+		arlalib_destroyconn (conn);
+		conn = arlalib_getconnbyaddr(NULL, server.s_addr,
+					     NULL, port,
+					     VOTE_SERVICE_ID, auth);
+		if (conn == NULL) {
+		    warnx("Could not contact host %s", inet_ntoa(server));
+		    return;
+		}
+	    }
 
 	    for (i = 0; i < db.nServers - 1; i++) {
 		
@@ -191,10 +210,6 @@
 		printf("\n");
 
 	    }
-	} else {
-	    server.s_addr = htonl(db.syncHost);
-	    printf("I'm not the synchost, but %s is.\n",
-		   inet_ntoa(server));    
 	}
     }
 }
@@ -220,6 +235,8 @@
 		state = HOST;
 	    else if (strcmp(*argv, "-port") == 0) 
 		state = PORT;
+	    else if (strcmp(*argv, "-long") == 0)
+		verbose = 1;
 	    else 
 		usage();
 	} else {





More information about the Arla-drinkers mailing list