]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Paxos: get rid of the 'prepare_bootstrap()' mechanism 311/head
authorJoao Eduardo Luis <joao.luis@inktank.com>
Wed, 22 May 2013 12:59:08 +0000 (13:59 +0100)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Wed, 22 May 2013 16:12:38 +0000 (17:12 +0100)
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 <joao.luis@inktank.com>
src/mon/MonmapMonitor.cc
src/mon/Paxos.cc
src/mon/Paxos.h
src/mon/PaxosService.h

index badac7e09226147f003f7d177eec4111ccbed53d..d7472797f15c5d47c8724b3f603b0002562ddb38 100644 (file)
@@ -111,7 +111,7 @@ void MonmapMonitor::update_from_paxos()
   }
 
   if (need_restart) {
-    paxos->prepare_bootstrap();
+    mon->bootstrap();
   }
 }
 
index 1c2333c094942a48d2e37bf0dcc2f93751f0b581..bfb9ed4f5dd3a560a288bff35e5ac537de415fdd 100644 (file)
@@ -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);
index 2e1bb62dda9c5d41aa0058f8add29d0fc262ce40..160b02ecef25857447a4e8be0a310b9b5fd11fda 100644 (file)
@@ -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();
index 0e4c9e23b025b3af5e3b9afc52c7067298a743b3..4de73ea4b19794e72e1c3c2d8abb1449eba68417 100644 (file)
@@ -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;
     }