]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Modified an if statement to check if there were maps to trim 63890/head
authorshreya subramanian <shsubramanian@g.hmc.edu>
Wed, 11 Jun 2025 21:54:12 +0000 (21:54 +0000)
committershreya subramanian <Shreya.Subramanian@ibm.com>
Thu, 12 Jun 2025 18:40:05 +0000 (18:40 +0000)
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 <Shreya.Subramanian@ibm.com>
src/mon/PaxosService.cc

index ce2c5977f2e2d76ac550e84c35515193c8b86b0c..315539b93d0fcf6a0fc28d26fb95d2dd3f8880e7 100644 (file)
@@ -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;
   }