From 69def1433d49bd8543e26e9f1ebf00dfbc5059bd Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 5 Dec 2019 21:00:33 +0000 Subject: [PATCH] PG: drop replica reads from prior intervals Otherwise, they cause misdirected op warnings. See comment for details. Signed-off-by: Samuel Just --- src/osd/PG.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index c9a7a1bda01b7..db29e0056ace2 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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)) { -- 2.39.5