]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Elector: reset the acked leader when the election finishes and we lost
authorJoao Eduardo Luis <joao.luis@inktank.com>
Sun, 27 Jan 2013 18:08:15 +0000 (18:08 +0000)
committerSage Weil <sage@inktank.com>
Tue, 29 Jan 2013 01:12:25 +0000 (17:12 -0800)
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 <joao.luis@inktank.com>
(cherry picked from commit c54781618569680898e77e151dd7364f22ac4aa1)

src/mon/Elector.cc

index e2ffa6bd571a45e8e1eb16031101b322d3dcfc80..199eaeae5384a3af705a1b2319c5730780ab48a5 100644 (file)
@@ -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;