From: Samuel Just Date: Thu, 5 Dec 2019 21:00:33 +0000 (+0000) Subject: PG: drop replica reads from prior intervals X-Git-Tag: v15.1.0~411^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=69def1433d49bd8543e26e9f1ebf00dfbc5059bd;p=ceph.git PG: drop replica reads from prior intervals Otherwise, they cause misdirected op warnings. See comment for details. Signed-off-by: Samuel Just --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index c9a7a1bda01b..db29e0056ace 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)) {