From c54781618569680898e77e151dd7364f22ac4aa1 Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Sun, 27 Jan 2013 18:08:15 +0000 Subject: [PATCH] mon: Elector: reset the acked leader when the election finishes and we lost Failure to do so will mean that we will always ack the same leader during an election started by another monitor. This had been working so far because we were still acking the existing leader if he was supposed to still be the leader; or we were acking a new potentially leader; or we would eventually fall behind on an election and start a new election ourselves, thus resetting the previously acked leader. While this wasn't something that mattered much until now, the timechecks code stumbled into this tiny issue and was failing hard at completing a round because there wouldn't be a reset before the election started -- timechecks are bound to election epochs. Fixes: #3854 Signed-off-by: Joao Eduardo Luis --- src/mon/Elector.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mon/Elector.cc b/src/mon/Elector.cc index e2ffa6bd571a4..199eaeae5384a 100644 --- a/src/mon/Elector.cc +++ b/src/mon/Elector.cc @@ -271,6 +271,8 @@ void Elector::handle_victory(MMonElection *m) assert(from < mon->rank); assert(m->epoch % 2 == 0); + leader_acked = -1; + // i should have seen this election if i'm getting the victory. if (m->epoch != epoch + 1) { dout(5) << "woah, that's a funny epoch, i must have rebooted. bumping and re-starting!" << dendl; -- 2.39.5