]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: config min paxos txns to keep separately
authorSage Weil <sage@inktank.com>
Fri, 5 Jul 2013 17:34:46 +0000 (10:34 -0700)
committerSage Weil <sage@inktank.com>
Tue, 9 Jul 2013 18:05:47 +0000 (11:05 -0700)
We were using paxos_max_join_drift to control the minimum number of
paxos transactions to keep around.  Instead, make this explicit, and
separate from the join drift.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/config_opts.h
src/mon/Paxos.cc
src/mon/Paxos.h

index ec12228413dbcf902ab21910c9aef0d2119f2484..6fb7a13c37f81fa68a94759639937af1874d4ce6 100644 (file)
@@ -199,6 +199,7 @@ OPTION(paxos_stash_full_interval, OPT_INT, 25)   // how often (in commits) to st
 OPTION(paxos_max_join_drift, OPT_INT, 10) // max paxos iterations before we must first sync the monitor stores
 OPTION(paxos_propose_interval, OPT_DOUBLE, 1.0)  // gather updates for this long before proposing a map update
 OPTION(paxos_min_wait, OPT_DOUBLE, 0.05)  // min time to gather updates for after period of inactivity
+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
index ea777c4912eea8493a12f6f10233f7fc6170c7bd..eb3c294f568c6902a3e522441eff38b040a15e77 100644 (file)
@@ -952,8 +952,8 @@ void Paxos::lease_renew_timeout()
 void Paxos::trim()
 {
   assert(should_trim());
-  version_t end = MIN(get_version() - g_conf->paxos_max_join_drift,
-                       get_first_committed() + g_conf->paxos_trim_max);
+  version_t end = MIN(get_version() - g_conf->paxos_min,
+                     get_first_committed() + g_conf->paxos_trim_max);
 
   if (first_committed >= end)
     return;
index c8a37e2aa65f6ed0d544eea9930365c62f0685ff..dc3670aa8cb13bbd6f2eba178548905431f82097 100644 (file)
@@ -1164,9 +1164,8 @@ public:
    * @returns true if we should trim; false otherwise.
    */
   bool should_trim() {
-    int available_versions = (get_version() - get_first_committed());
-    int maximum_versions =
-      (g_conf->paxos_max_join_drift + g_conf->paxos_trim_min);
+    int available_versions = get_version() - get_first_committed();
+    int maximum_versions = g_conf->paxos_min + g_conf->paxos_trim_min;
 
     if (trimming || (available_versions <= maximum_versions))
       return false;