]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: wait for paxos writes before touching state 2655/head
authorSage Weil <sage@redhat.com>
Wed, 1 Oct 2014 00:18:49 +0000 (17:18 -0700)
committerSage Weil <sage@redhat.com>
Wed, 1 Oct 2014 00:19:37 +0000 (17:19 -0700)
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 <sage@redhat.com>
src/mon/Monitor.cc
src/mon/Monitor.h

index 81fc2999897128cd0357b683908ffe558aa4ecc3..50b29433f111468aafd36fcbb2b9017052b2f6c8 100644 (file)
@@ -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;
 
index 0601771a36f6a034fec37f06f5d538b1dbe1bece..bcf9943faadb178e5bad135dbb2901e2458f13b1 100644 (file)
@@ -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();