We had duplicated code in election_finished() and restart(), and it was
incomplete. Put it all in restart() only (the mon should have called
restart() long before the election finishes). Note that we cannot
assert as much in election_finished() because another service may have
just cross-proposed.
Signed-off-by: Sage Weil <sage@inktank.com>
finish_contexts(g_ceph_context, waiting_for_finished_proposal, -EAGAIN);
+ if (have_pending) {
+ discard_pending();
+ have_pending = false;
+ }
+ proposing = false;
+
on_restart();
}
{
dout(10) << "election_finished" << dendl;
- if (proposal_timer) {
- dout(10) << " canceling proposal_timer " << proposal_timer << dendl;
- mon->timer.cancel_event(proposal_timer);
- proposal_timer = 0;
- }
-
- if (have_pending) {
- discard_pending();
- have_pending = false;
- }
- proposing = false;
-
finish_contexts(g_ceph_context, waiting_for_finished_proposal, -EAGAIN);
// make sure we update our state