From: Sage Weil Date: Fri, 31 May 2013 23:39:37 +0000 (-0700) Subject: mon/Paxos: go active *after* refreshing X-Git-Tag: v0.66~47^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e68b1bd36ed285e38a558899f83cf224d3aa60ed;p=ceph.git mon/Paxos: go active *after* refreshing 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 --- diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index 0d6d96de2e3..d76c715fe69 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -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());