]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: go active *after* refreshing
authorSage Weil <sage@inktank.com>
Fri, 31 May 2013 23:39:37 +0000 (16:39 -0700)
committerSage Weil <sage@inktank.com>
Wed, 19 Jun 2013 18:27:04 +0000 (11:27 -0700)
The update_from_paxos() methods occasionally like to trigger new activity.
As long as they check is_readable() and is_writeable(), they will defer
until we go active and that activity will happen in the normal callbacks.

This fixes the problem where we active but is_writeable() is still false,
triggered by PGMonitor::check_osd_map().

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Paxos.cc

index 0d6d96de2e3acb40176e7439394a7250b6eaa90c..d76c715fe69ae8ab513cc2c86532ce6f23f71132 100644 (file)
@@ -435,7 +435,6 @@ void Paxos::handle_last(MMonPaxos *last)
        begin(uncommitted_value);
       } else {
        // active!
-       state = STATE_ACTIVE;
        dout(10) << "that's everyone.  active!" << dendl;
        extend_lease();
 
@@ -508,7 +507,6 @@ void Paxos::begin(bufferlist& v)
   if (mon->get_quorum().size() == 1) {
     // we're alone, take it easy
     commit();
-    state = STATE_ACTIVE;
     finish_proposal();
     finish_contexts(g_ceph_context, waiting_for_active);
     finish_contexts(g_ceph_context, waiting_for_commit);
@@ -624,7 +622,6 @@ void Paxos::handle_accept(MMonPaxos *accept)
     accept_timeout_event = 0;
 
     // yay!
-    state = STATE_ACTIVE;
     extend_lease();
 
     finish_proposal();
@@ -723,7 +720,7 @@ void Paxos::handle_commit(MMonPaxos *commit)
 void Paxos::extend_lease()
 {
   assert(mon->is_leader());
-  assert(is_active());
+  //assert(is_active());
 
   lease_expire = ceph_clock_now(g_ceph_context);
   lease_expire += g_conf->mon_lease;
@@ -789,6 +786,9 @@ void Paxos::finish_proposal()
   bool need_bootstrap = false;
   mon->refresh_from_paxos(&need_bootstrap);
 
+  // ok, now go active!
+  state = STATE_ACTIVE;
+
   // finish off the last proposal
   if (!proposals.empty()) {
     assert(mon->is_leader());