]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd/pg: discard ops in case of split
authorAishwarya Mathuria <amathuri@redhat.com>
Fri, 1 Aug 2025 10:06:19 +0000 (10:06 +0000)
committerAishwarya Mathuria <amathuri@redhat.com>
Thu, 21 Aug 2025 13:58:12 +0000 (13:58 +0000)
Clients will take care of re-sending the ops.
We can discard it here.

Signed-off-by: Aishwarya Mathuria <amathuri@redhat.com>
src/crimson/osd/pg.cc

index f85ee660abbcde17d59e02d4ef50804b0aba6457..c7ae18d2f252bd0785104e2918fd67625450697c 100644 (file)
@@ -1617,6 +1617,15 @@ bool PG::can_discard_op(const MOSDOp& m) const {
       // (us).
       return true;
     }
+
+  // Note: the Objecter will resend on pg split
+  // hence we can discard ops here.
+  // Refer: https://github.com/ceph/ceph/pull/13235
+  if (m.get_map_epoch() < peering_state.get_info().history.last_epoch_split) {
+    logger().debug("{} pg split in {} dropping!", __func__,
+        peering_state.get_info().history.last_epoch_split);
+    return true;
+  }
   return __builtin_expect(m.get_map_epoch()
       < peering_state.get_info().history.same_primary_since, false);
 }