From: Sage Weil Date: Fri, 5 Jul 2013 17:34:46 +0000 (-0700) Subject: mon/Paxos: config min paxos txns to keep separately X-Git-Tag: v0.67-rc1~126^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aa33bc88aabe709952fa4ab28e0710cc7f1913a5;p=ceph.git mon/Paxos: config min paxos txns to keep separately 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 --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index ec12228413db..6fb7a13c37f8 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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 diff --git a/src/mon/Paxos.cc b/src/mon/Paxos.cc index ea777c4912ee..eb3c294f568c 100644 --- a/src/mon/Paxos.cc +++ b/src/mon/Paxos.cc @@ -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; diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index c8a37e2aa65f..dc3670aa8cb1 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -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;