:Default: ``500``
-``mon_mds_force_trim_to``
+``paxos service trim max multiplier``
+
+:Description: The factor by which paxos service trim max will be multiplied
+ to get a new upper bound when trim sizes are high (0 disables it)
+:Type: Integer
+:Default: ``20``
+
+
+``mon mds force trim to``
:Description: Force monitor to trim mdsmaps to this point (0 disables it.
dangerous, use with care)
.add_service("mon")
.set_description(""),
- Option("paxos_service_trim_min", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("paxos_service_trim_min", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(250)
.add_service("mon")
.set_description(""),
- Option("paxos_service_trim_max", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("paxos_service_trim_max", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(500)
.add_service("mon")
.set_description(""),
+ Option("paxos_service_trim_max_multiplier", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+ .set_default(20)
+ .set_min(0)
+ .add_service("mon")
+ .set_description("factor by which paxos_service_trim_max will be multiplied to get a new upper bound when trim sizes are high (0 disables it)")
+ .set_flag(Option::FLAG_RUNTIME),
+
Option("paxos_kill_at", Option::TYPE_INT, Option::LEVEL_DEV)
.set_default(0)
.add_service("mon")
return;
}
- const version_t trim_max = g_conf().get_val<version_t>("paxos_service_trim_max");
- if (trim_max > 0 &&
- to_remove > trim_max) {
- dout(10) << __func__ << " trim_to " << trim_to << " would only trim " << to_remove
- << " > paxos_service_trim_max, limiting to " << trim_max
- << dendl;
- trim_to = get_first_committed() + trim_max;
- to_remove = trim_max;
- }
+ to_remove = [to_remove, this] {
+ const version_t trim_max = g_conf().get_val<version_t>("paxos_service_trim_max");
+ if (trim_max == 0 || to_remove < trim_max) {
+ return to_remove;
+ }
+ if (to_remove < trim_max * 1.5) {
+ dout(10) << __func__ << " trim to " << get_trim_to() << " would only trim " << to_remove
+ << " > paxos_service_trim_max, limiting to " << trim_max
+ << dendl;
+ return trim_max;
+ }
+ const version_t new_trim_max = (trim_max + to_remove) / 2;
+ const uint64_t trim_max_multiplier = g_conf().get_val<uint64_t>("paxos_service_trim_max_multiplier");
+ if (trim_max_multiplier) {
+ return std::min(new_trim_max, trim_max * trim_max_multiplier);
+ } else {
+ return new_trim_max;
+ }
+ }();
+ trim_to = get_first_committed() + to_remove;
dout(10) << __func__ << " trimming to " << trim_to << ", " << to_remove << " states" << dendl;
MonitorDBStore::TransactionRef t = paxos.get_pending_transaction();