From 3d98e57287201e40bc7125efc9c3c504f468265f Mon Sep 17 00:00:00 2001 From: shreya subramanian Date: Wed, 11 Jun 2025 21:54:12 +0000 Subject: [PATCH] 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 --- src/mon/PaxosService.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index ce2c5977f2e2d..315539b93d0fc 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; } -- 2.39.5