diff options
author | Sage Weil <sage@inktank.com> | 2013-05-31 16:39:37 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-17 14:24:44 -0700 |
commit | aabbe5e0e15e31fdd98586193564cc7a4efd49ed (patch) | |
tree | 341c41e4f733391c2346d259e621db81421e0d0b | |
parent | 19bcd389bb4fa36838565d8c5ea6b03984ed0709 (diff) | |
download | ceph-aabbe5e0e15e31fdd98586193564cc7a4efd49ed.tar.gz |
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 <sage@inktank.com>
-rw-r--r-- | src/mon/Paxos.cc | 8 |
1 files changed, 4 insertions, 4 deletions
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()); |