From: Kefu Chai Date: Mon, 28 Mar 2016 04:19:29 +0000 (+0800) Subject: mon: remove remove_legacy_versions() X-Git-Tag: v10.1.1~33^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=00cb296a523996bbf52a7392a32462889b5aff7d;p=ceph.git mon: remove remove_legacy_versions() 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 --- diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index 52b0bda43c36..5835579995ce 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -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 diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index 052cd76aea0d..3f2a6337c19a 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -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. diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index ab169b8b9c39..cde3faa3546d 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -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; diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index 77c62253dbf2..577af7df89c9 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -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: /**