]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove remove_legacy_versions() 8324/head
authorKefu Chai <kchai@redhat.com>
Mon, 28 Mar 2016 04:19:29 +0000 (12:19 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 28 Mar 2016 04:37:11 +0000 (12:37 +0800)
as it's required to upgrade to hammer before moving to jewel, and
hammer is already using the single-paxos monitor. and we convert
the store.db when starting up from an old monitor (bobtail). we
stopped the conversion since 1d814b7.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/Paxos.cc
src/mon/Paxos.h
src/mon/PaxosService.cc
src/mon/PaxosService.h

index 52b0bda43c36b6a5f55519a9c4ebe6f2a403daec..5835579995cef438718dfe4e04e518afcaf345e2 100644 (file)
@@ -425,26 +425,9 @@ bool Paxos::store_state(MMonPaxos *m)
     changed = true;
   }
 
-  remove_legacy_versions();
-
   return changed;
 }
 
-void Paxos::remove_legacy_versions()
-{
-  if (get_store()->exists(get_name(), "conversion_first")) {
-    MonitorDBStore::TransactionRef t(new MonitorDBStore::Transaction);
-    version_t v = get_store()->get(get_name(), "conversion_first");
-    dout(10) << __func__ << " removing pre-conversion paxos states from " << v
-            << " until " << first_committed << dendl;
-    for (; v < first_committed; ++v) {
-      t->erase(get_name(), v);
-    }
-    t->erase(get_name(), "conversion_first");
-    get_store()->apply_transaction(t);
-  }
-}
-
 void Paxos::_sanity_check_store()
 {
   version_t lc = get_store()->get(get_name(), "last_committed");
@@ -901,8 +884,6 @@ void Paxos::commit_finish()
   // get ready for a new round.
   new_value.clear();
 
-  remove_legacy_versions();
-
   // WRITING -> REFRESH
   // among other things, this lets do_refresh() -> mon->bootstrap() know
   // it doesn't need to flush the store queue
index 052cd76aea0de2ac35d09f0587ba83e40b2cf221..3f2a6337c19aa42cc12b0012437a3004368e008b 100644 (file)
@@ -1187,11 +1187,6 @@ public:
   bool store_state(MMonPaxos *m);
   void _sanity_check_store();
 
-  /**
-   * remove legacy paxos versions from before conversion
-   */
-  void remove_legacy_versions();
-
   /**
    * Helper function to decode a bufferlist into a transaction and append it
    * to another transaction.
index ab169b8b9c39ba43834eafa849ff7c224f307081..cde3faa3546d8e9647569da84c8445d741bf8b6d 100644 (file)
@@ -144,26 +144,6 @@ void PaxosService::post_refresh()
   }
 }
 
-void PaxosService::remove_legacy_versions()
-{
-  dout(10) << __func__ << dendl;
-  if (!mon->store->exists(get_service_name(), "conversion_first"))
-    return;
-
-  version_t cf = mon->store->get(get_service_name(), "conversion_first");
-  version_t fc = get_first_committed();
-
-  dout(10) << __func__ << " conversion_first " << cf
-          << " first committed " << fc << dendl;
-
-  MonitorDBStore::TransactionRef t(new MonitorDBStore::Transaction);
-  if (cf < fc) {
-    trim(t, cf, fc);
-  }
-  t->erase(get_service_name(), "conversion_first");
-  mon->store->apply_transaction(t);
-}
-
 bool PaxosService::should_propose(double& delay)
 {
   // simple default policy: quick startup, then some damping.
@@ -278,8 +258,6 @@ void PaxosService::_active()
   }
   dout(10) << "_active" << dendl;
 
-  remove_legacy_versions();
-
   // create pending state?
   if (mon->is_leader() && is_active()) {
     dout(7) << "_active creating new pending" << dendl;
index 77c62253dbf2a6d410d0a63ef0d434ffd0b58944..577af7df89c9021935a1aa11f1a23f0385b9610d 100644 (file)
@@ -257,11 +257,6 @@ private:
    *      active
    */
   void _active();
-  /**
-   * Scrub our versions after we convert the store from the old layout to
-   * the new k/v store.
-   */
-  void remove_legacy_versions();
 
 public:
   /**