From: Joao Eduardo Luis Date: Wed, 22 May 2013 12:59:08 +0000 (+0100) Subject: mon: Paxos: get rid of the 'prepare_bootstrap()' mechanism X-Git-Tag: v0.63~5^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e15d29094503f279d444eda246fc45c09f5535c9;p=ceph.git mon: Paxos: get rid of the 'prepare_bootstrap()' mechanism We don't need it after all. If we are in the middle of some proposal, then we guarantee that said proposal is likely to be retried. If we haven't yet proposed, then it's forever more likely that a client will eventually retry the message that triggered this proposal. Basically, this mechanism attempted at fixing a non-problem, and was in fact triggering some unforeseen issues that would have required increasing the code complexity for no good reason. Fixes: #5102 Signed-off-by: Joao Eduardo Luis --- diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index badac7e09226..d7472797f15c 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -111,7 +111,7 @@ void MonmapMonitor::update_from_paxos() } if (need_restart) { - paxos->prepare_bootstrap(); + mon->bootstrap(); } } diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index 1c2333c09494..bfb9ed4f5dd3 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -37,13 +37,6 @@ static ostream& _prefix(std::ostream *_dout, Monitor *mon, const string& name, << ") "; } -void Paxos::prepare_bootstrap() -{ - dout(0) << __func__ << dendl; - - going_to_bootstrap = true; -} - MonitorDBStore *Paxos::get_store() { return mon->store; @@ -836,12 +829,6 @@ void Paxos::finish_proposal() first_committed = get_store()->get(get_name(), "first_committed"); last_committed = get_store()->get(get_name(), "last_committed"); - if (proposals.empty() && going_to_bootstrap) { - dout(0) << __func__ << " no more proposals; bootstraping." << dendl; - mon->bootstrap(); - return; - } - if (should_trim()) { trim(); } @@ -1097,8 +1084,6 @@ void Paxos::leader_init() if (!proposals.empty()) finish_contexts(g_ceph_context, proposals, -EAGAIN); - going_to_bootstrap = false; - if (mon->get_quorum().size() == 1) { state = STATE_ACTIVE; return; @@ -1132,7 +1117,6 @@ void Paxos::restart() new_value.clear(); state = STATE_RECOVERING; - going_to_bootstrap = false; if (!proposals.empty()) finish_contexts(g_ceph_context, proposals, -EAGAIN); diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index 2e1bb62dda9c..160b02ecef25 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -530,7 +530,6 @@ private: * @} */ - bool going_to_bootstrap; /** * Should be true if we have proposed to trim, or are in the middle of * trimming; false otherwise. @@ -1017,7 +1016,6 @@ public: lease_timeout_event(0), accept_timeout_event(0), clock_drift_warned(0), - going_to_bootstrap(false), going_to_trim(false), trim_disabled_version(0) { } @@ -1025,9 +1023,6 @@ public: return paxos_name; } - bool is_bootstrapping() { return going_to_bootstrap; } - void prepare_bootstrap(); - void dispatch(PaxosServiceMessage *m); void reapply_all_versions(); diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index 0e4c9e23b025..4de73ea4b197 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -498,8 +498,7 @@ public: */ bool is_active() { return (!is_proposing() && !paxos->is_recovering() - && !paxos->is_locked() - && !paxos->is_bootstrapping()); + && !paxos->is_locked()); } /** @@ -579,7 +578,7 @@ public: * @param c The callback to be awaken once we become active. */ void wait_for_active(Context *c) { - if (paxos->is_bootstrapping() || !is_proposing()) { + if (!is_proposing()) { paxos->wait_for_active(c); return; } @@ -612,7 +611,7 @@ public: * @param c The callback to be awaken once we become writeable. */ void wait_for_writeable(Context *c) { - if (paxos->is_bootstrapping() || !is_proposing()) { + if (!is_proposing()) { paxos->wait_for_writeable(c); return; }