From: Sage Weil Date: Fri, 5 Jul 2013 17:36:54 +0000 (-0700) Subject: mon/Paxos: remove unnecessary trim enable/disable X-Git-Tag: v0.67-rc1~126^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ccceeee57b4b31709a79b146c5075ef2a909568d;p=ceph.git mon/Paxos: remove unnecessary trim enable/disable The sync no longer cares if we trim Paxos versions as we go, as long as we don't trim so fast that we fall behind between GET_CHUNK messages, which we can consider a tuning problem. Remove this extra complexity! Signed-off-by: Sage Weil --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 6fb7a13c37f8..5f355db542e4 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -202,7 +202,6 @@ OPTION(paxos_min_wait, OPT_DOUBLE, 0.05) // min time to gather updates for afte OPTION(paxos_min, OPT_INT, 500) // minimum number of paxos states to keep around OPTION(paxos_trim_min, OPT_INT, 250) // number of extra proposals tolerated before trimming OPTION(paxos_trim_max, OPT_INT, 500) // max number of extra proposals to trim at a time -OPTION(paxos_trim_disabled_max_versions, OPT_INT, 108000) // maximum amount of versions we shall allow passing by without trimming OPTION(paxos_service_trim_min, OPT_INT, 250) // minimum amount of versions to trigger a trim (0 disables it) OPTION(paxos_service_trim_max, OPT_INT, 500) // maximum amount of versions to trim during a single proposal (0 disables it) OPTION(clock_offset, OPT_DOUBLE, 0) // how much to offset the system clock in Clock.cc diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index eb3c294f568c..b6cf46d36524 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -985,17 +985,6 @@ void Paxos::trim() queue_proposal(bl, new C_Trimmed(this)); } -void Paxos::trim_enable() -{ - trim_disabled_version = 0; - // We may not be the leader when we reach this function. We sure must - // have been the leader at some point, but we may have been demoted and - // we really should reset 'trim_disabled_version' if that was the case. - // So, make sure we only trim() iff we are the leader. - if (mon->is_leader() && should_trim()) - trim(); -} - /* * return a globally unique, monotonically increasing proposal number */ @@ -1009,7 +998,7 @@ version_t Paxos::get_new_proposal_number(version_t gt) last_pn++; last_pn *= 100; last_pn += (version_t)mon->rank; - + // write MonitorDBStore::Transaction t; t.put(get_name(), "last_pn", last_pn); diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index dc3670aa8cb1..1cdad50e5bbe 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -530,12 +530,6 @@ private: * trimming; false otherwise. */ bool trimming; - /** - * If we have disabled trimming our state, this variable should have a - * value greater than zero, corresponding to the version we had at the time - * we disabled the trim. - */ - version_t trim_disabled_version; /** * @defgroup Paxos_h_callbacks Callback classes. @@ -1013,8 +1007,7 @@ public: lease_timeout_event(0), accept_timeout_event(0), clock_drift_warned(0), - trimming(false), - trim_disabled_version(0) { } + trimming(false) { } const string get_name() const { return paxos_name; @@ -1135,26 +1128,6 @@ public: */ void trim(); - /** - * Disable trimming - * - * This is required by the Monitor's store synchronization mechanisms - * to guarantee a consistent store state. - */ - void trim_disable() { - if (!trim_disabled_version) - trim_disabled_version = get_version(); - } - /** - * Enable trimming - */ - void trim_enable(); - /** - * Check if trimming has been disabled - * - * @returns true if trim has been disabled; false otherwise. - */ - bool is_trim_disabled() { return (trim_disabled_version > 0); } /** * Check if we should trim. * @@ -1170,11 +1143,6 @@ public: if (trimming || (available_versions <= maximum_versions)) return false; - if (trim_disabled_version > 0) { - int disabled_versions = (get_version() - trim_disabled_version); - if (disabled_versions < g_conf->paxos_trim_disabled_max_versions) - return false; - } return true; }