From: Aishwarya Mathuria Date: Mon, 29 Mar 2021 14:05:12 +0000 (+0530) Subject: mon: Adding variables for Paxos trim X-Git-Tag: v17.1.0~2386^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=45c59f2f0d0d90beb9163804e86139c551cf505b;p=ceph.git mon: Adding variables for Paxos trim 1. Define variables for paxos_service_trim_min and paxos_service_trim_max. 2. Use them in place of g_conf()→paxos_service_trim_min and g_conf()→paxos_service_trim_max Signed-off-by: Aishwarya Mathuria --- diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index 8dff901c0676..8366bc704b57 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -385,20 +385,22 @@ void PaxosService::maybe_trim() } version_t to_remove = trim_to - get_first_committed(); - if (g_conf()->paxos_service_trim_min > 0 && - to_remove < (version_t)g_conf()->paxos_service_trim_min) { + const version_t trim_min = g_conf().get_val("paxos_service_trim_min"); + if (trim_min > 0 && + to_remove < trim_min) { dout(10) << __func__ << " trim_to " << trim_to << " would only trim " << to_remove - << " < paxos_service_trim_min " << g_conf()->paxos_service_trim_min << dendl; + << " < paxos_service_trim_min " << trim_min << dendl; return; } - if (g_conf()->paxos_service_trim_max > 0 && - to_remove > (version_t)g_conf()->paxos_service_trim_max) { + const version_t trim_max = g_conf().get_val("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 " << g_conf()->paxos_service_trim_max + << " > paxos_service_trim_max, limiting to " << trim_max << dendl; - trim_to = get_first_committed() + g_conf()->paxos_service_trim_max; - to_remove = g_conf()->paxos_service_trim_max; + trim_to = get_first_committed() + trim_max; + to_remove = trim_max; } dout(10) << __func__ << " trimming to " << trim_to << ", " << to_remove << " states" << dendl;