]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: drop replica reads from prior intervals
authorSamuel Just <sjust@redhat.com>
Thu, 5 Dec 2019 21:00:33 +0000 (21:00 +0000)
committerSamuel Just <sjust@redhat.com>
Fri, 20 Dec 2019 01:35:37 +0000 (17:35 -0800)
Otherwise, they cause misdirected op warnings.

See comment for details.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PG.cc

index c9a7a1bda01b72ea39da4ac68c5fe279b71b8c7e..db29e0056ace20fb5d1ad9299f55fb5daf580976 100644 (file)
@@ -3449,6 +3449,19 @@ bool PG::can_discard_op(OpRequestRef& op)
     return true;
   }
 
+  if ((m->get_flags() & (CEPH_OSD_FLAG_BALANCE_READS |
+                        CEPH_OSD_FLAG_LOCALIZE_READS)) &&
+      !is_primary() &&
+      m->get_map_epoch() < info.history.same_interval_since) {
+    // Note: the Objecter will resend on interval change without the primary
+    // changing if it actually sent to a replica.  If the primary hasn't
+    // changed since the send epoch, we got it, and we're primary, it won't
+    // have resent even if the interval did change as it sent it to the primary
+    // (us).
+    return true;
+  }
+
+
   if (m->get_connection()->has_feature(CEPH_FEATURE_RESEND_ON_SPLIT)) {
     // >= luminous client
     if (m->get_connection()->has_feature(CEPH_FEATURE_SERVER_NAUTILUS)) {