summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-05-31 16:39:37 -0700
committerSage Weil <sage@inktank.com>2013-06-24 16:16:41 -0700
commitfd1769cb2d61e8f2c7921a78760e8f12b28258fb (patch)
tree4811f9d87f665f6d85e2dccabcb26e33835ffa84
parentcf75478d027dfd377424988745230d096dae79ac (diff)
downloadceph-fd1769cb2d61e8f2c7921a78760e8f12b28258fb.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> (cherry picked from commit e68b1bd36ed285e38a558899f83cf224d3aa60ed)
-rw-r--r--src/mon/Paxos.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc
index 0c3c603002c..243c878e1f9 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());