ubik: Don't clear ubik_lastYesTime on startup 79/12279/2
authorAndrew Deason <adeason@dson.org>
Thu, 5 May 2016 05:01:22 +0000 (00:01 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 6 May 2016 03:20:29 +0000 (23:20 -0400)
In uvote_Init, we set ubik_lastYesTime to the current time just a few
lines before. It is important to set ubik_lastYesTime to the current
time, since that prevents us from voting for anyone in an ubik
election for at least BIGTIME seconds.

If we clear ubik_lastYesTime to 0, that means restarting a ubik server
could cause it to immediately start voting for a different site than
it was voting for before it started. This violates one of the ubik
invariants; as mentioned in the comments in SVOTE_Beacon, we cannot
promise sync site support to more than one site within BIGTIME
seconds. So initializing ubik_lastYesTime to 0 could cause two
different sites to be voted sync site simultaneously, if our restart
caused a premature change in vote.

Change-Id: I410fbefa8d699aac1c900d1fdd4e355b87917ad7
Reviewed-on: https://gerrit.openafs.org/12279
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/ubik/vote.c

index ce44b62..51b9220 100644 (file)
@@ -595,7 +595,6 @@ uvote_Init(void)
     vote_globals.ubik_lastYesTime = FT_ApproxTime();
 
     /* Initialize globals */
-    vote_globals.ubik_lastYesTime = 0;
     vote_globals.lastYesHost = 0xffffffff;
     vote_globals.lastYesClaim = 0;
     vote_globals.lastYesState = 0;