From: shreya subramanian Date: Wed, 11 Jun 2025 21:54:12 +0000 (+0000) Subject: mon: Modified an if statement to check if there were maps to trim X-Git-Tag: v21.0.0~256^2~185^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3d98e57287201e40bc7125efc9c3c504f468265f;p=ceph.git mon: Modified an if statement to check if there were maps to trim When to_remove is 0 and first commited is 0 the maybe trim function in paxos service.cc calls the trim function with argument to and from having the same value, which causes the assert statement in the trim function to fail and the monitor to crash. Modifying the if statement trim_to <= first commited checks this condition before calling the trim function and returns if true Fixes: https://tracker.ceph.com/issues/71610 Signed-off-by: Shreya Subramanian --- diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index ce2c5977f2e2..315539b93d0f 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -391,8 +391,8 @@ void PaxosService::maybe_trim() version_t trim_to = get_trim_to(); dout(20) << __func__ << " " << first_committed << "~" << trim_to << dendl; - if (trim_to < first_committed) { - dout(10) << __func__ << " trim_to " << trim_to << " < first_committed " + if (trim_to <= first_committed) { + dout(10) << __func__ << " trim_to " << trim_to << " <= first_committed " << first_committed << dendl; return; }