]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: remove unnecessary trim enable/disable
authorSage Weil <sage@inktank.com>
Fri, 5 Jul 2013 17:36:54 +0000 (10:36 -0700)
committerSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 18:05:48 +0000 (11:05 -0700)
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 <sage@inktank.com>
src/common/config_opts.h
src/mon/Paxos.cc
src/mon/Paxos.h

index 6fb7a13c37f81fa68a94759639937af1874d4ce6..5f355db542e4b3600d5a6762ce956383a58fcec9 100644 (file)
@@ -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
index eb3c294f568c6902a3e522441eff38b040a15e77..b6cf46d36524b8bbfb6bf13158b1d033428aab52 100644 (file)
@@ -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);
index dc3670aa8cb13bbd6f2eba178548905431f82097..1cdad50e5bbedc76cbd9a268c26ae06e07b7f0c8 100644 (file)
@@ -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;
   }