From: Aishwarya Mathuria Date: Mon, 29 Mar 2021 14:05:12 +0000 (+0530) Subject: mon: Adding variables for Paxos trim X-Git-Tag: v14.2.22~29^2~2^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=47127a9cb32b0399a10926b8b0875c794b4f5c23;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 (cherry picked from commit 45c59f2f0d0d90beb9163804e86139c551cf505b) --- diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index 06776635f949..987a55adb131 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -377,20 +377,22 @@ void PaxosService::maybe_trim() return; 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;