]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Paxos: configure minimum paxos txns separately
authorSage Weil <sage@inktank.com>
Thu, 4 Jul 2013 21:21:04 +0000 (14:21 -0700)
committerSage Weil <sage@inktank.com>
Fri, 5 Jul 2013 00:09:13 +0000 (17:09 -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.h

index b19d274eb2a26b8ec96e38fd312902f2eaf46710..ac0e8624497fef08dbe4ab6c7fefe968979abea8 100644 (file)
@@ -201,6 +201,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 transactions to keep around
 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, 108000) // maximum amount of versions we shall allow passing by without trimming
index 4f1af82836e5f82a2f98ddc5a9e25a010f18c48b..eeb1f34f1982c3ea4ad8eddeb3a5e76262dad933 100644 (file)
@@ -1151,7 +1151,7 @@ public:
    */
   void trim() {
     assert(should_trim());
-    version_t trim_to_version = MIN(get_version() - g_conf->paxos_max_join_drift,
+    version_t trim_to_version = MIN(get_version() - g_conf->paxos_min,
                                    get_first_committed() + g_conf->paxos_trim_max);
     trim_to(trim_to_version);
   }
@@ -1185,8 +1185,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_min);
+    int maximum_versions = (g_conf->paxos_min + g_conf->paxos_trim_min);
 
     if (going_to_trim || (available_versions <= maximum_versions))
       return false;