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)
commit562efa7e4c303acadf5c1df35c72674a3743c577
tree28a6fccfbc9ef64a34376c1d2e586387b8acb9e7
parent3c7a315b635fc4ee2118ee541f1169cf147622d5
ubik: Don't clear ubik_lastYesTime on startup

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