]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/pg: Add can_discard_op case
authorMatan Breizman <mbreizma@redhat.com>
Sun, 19 Feb 2023 11:35:03 +0000 (11:35 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 21 May 2023 08:12:29 +0000 (08:12 +0000)
discard op in the case where same_primary_since is later than
the MOSDOp's map epoch

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
(cherry picked from commit c6ab21791545598473bd044ce602eea2bba892d3)

src/crimson/osd/pg.cc

index 52aee483560cc7c843105bc04d31dcd43f507435..9400f1a260028d7140d885e4bfb106d6d7f021cf 100644 (file)
@@ -1452,6 +1452,13 @@ void PG::context_registry_on_change() {
 }
 
 bool PG::can_discard_op(const MOSDOp& m) const {
+  if (m.get_map_epoch() <
+      peering_state.get_info().history.same_primary_since) {
+    logger().debug("{} changed after {} dropping {} ",
+                   __func__ , m.get_map_epoch(), m);
+    return true;
+  }
+
   if ((m.get_flags() & (CEPH_OSD_FLAG_BALANCE_READS |
                         CEPH_OSD_FLAG_LOCALIZE_READS))
     && !is_primary()