]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: adjust trimming defaults up; rename options
authorSage Weil <sage@inktank.com>
Thu, 30 May 2013 22:59:49 +0000 (15:59 -0700)
committerSage Weil <sage@inktank.com>
Sat, 1 Jun 2013 00:05:03 +0000 (17:05 -0700)
- trim more at a time (by an order of magnitude)
- rename fields to paxos_trim_{min,max}; only trim when there are min items
  that are trimmable, and trim at most max items at a time.
- adjust the paxos_service_trim_{min,max} values up by a factor of 2.

Since we are compacting every time we trim, adjusting these up mean less
frequent compactions and less overall work for the monitor.

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

index 56a46aec0c0c20e20d0e16f73094a6cd015d6f2a..93f676b35d7075f562e27f6aa133b1223f95ba79 100644 (file)
@@ -203,10 +203,11 @@ 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_trim_tolerance, OPT_INT, 30) // number of extra proposals tolerated before trimming
+OPTION(paxos_trim_min, OPT_INT, 500)  // number of extra proposals tolerated before trimming
+OPTION(paxos_trim_max, OPT_INT, 1000) // max number of extra proposals to trim at a time
 OPTION(paxos_trim_disabled_max_versions, OPT_INT, 100) // maximum amount of versions we shall allow passing by without trimming
-OPTION(paxos_service_trim_max, OPT_INT, 500) // maximum amount of versions to trim during a single proposal (0 disables it)
-OPTION(paxos_service_trim_min, OPT_INT, 250) // minimum amount of versions to trigger a trim (0 disables it)
+OPTION(paxos_service_trim_min, OPT_INT, 500) // minimum amount of versions to trigger a trim (0 disables it)
+OPTION(paxos_service_trim_max, OPT_INT, 1000) // 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
 OPTION(auth_cluster_required, OPT_STR, "cephx")   // required of mon, mds, osd daemons
 OPTION(auth_service_required, OPT_STR, "cephx")   // required by daemons of clients
index 160b02ecef25857447a4e8be0a310b9b5fd11fda..be63889575e201478b987039c2ca96849d5808b0 100644 (file)
@@ -1154,7 +1154,8 @@ public:
    */
   void trim() {
     assert(should_trim());
-    version_t trim_to_version = get_version() - g_conf->paxos_max_join_drift;
+    version_t trim_to_version = MIN(get_version() - g_conf->paxos_max_join_drift,
+                                   get_first_committed() + g_conf->paxos_trim_max);
     trim_to(trim_to_version);
   }
   /**
@@ -1188,7 +1189,7 @@ public:
   bool should_trim() {
     int available_versions = (get_version() - get_first_committed());
     int maximum_versions =
-      (g_conf->paxos_max_join_drift + g_conf->paxos_trim_tolerance);
+      (g_conf->paxos_max_join_drift + g_conf->paxos_trim_min);
 
     if (going_to_trim || (available_versions <= maximum_versions))
       return false;