From 562efa7e4c303acadf5c1df35c72674a3743c577 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 5 May 2016 00:01:22 -0500 Subject: [PATCH] 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 Reviewed-by: Michael Meffie Reviewed-by: Jeffrey Altman Reviewed-by: Jeffrey Hutzelman Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- src/ubik/vote.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ubik/vote.c b/src/ubik/vote.c index ce44b62302..51b9220a71 100644 --- a/src/ubik/vote.c +++ b/src/ubik/vote.c @@ -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;