From: Sage Weil Date: Wed, 1 Oct 2014 00:18:49 +0000 (-0700) Subject: mon: wait for paxos writes before touching state X-Git-Tag: v0.87~40^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2655%2Fhead;p=ceph.git mon: wait for paxos writes before touching state Fix two other paths where may change the mon state so that we wait for the pending write first. start_election() in particular can be triggered at almost any time if we see an election message from another mon. Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 81fc2999897..50b29433f11 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -1805,6 +1805,7 @@ void Monitor::handle_probe_reply(MMonProbe *m) void Monitor::join_election() { dout(10) << __func__ << dendl; + wait_for_paxos_write(); _reset(); state = STATE_ELECTING; @@ -1814,6 +1815,7 @@ void Monitor::join_election() void Monitor::start_election() { dout(10) << "start_election" << dendl; + wait_for_paxos_write(); _reset(); state = STATE_ELECTING; diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index 0601771a36f..bcf9943faad 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -557,6 +557,7 @@ public: private: void _reset(); ///< called from bootstrap, start_, or join_election + void wait_for_paxos_write(); public: void bootstrap(); void join_election();