From 268df4862d95bf506ef6f594fdfa8294671babc3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 8 May 2014 10:50:51 -0700 Subject: [PATCH] osd: discard client ops sent before last_force_op_resend If an op is sent before last_force_op_resend, and the client's feature is present, drop the op because we know they will resend. Signed-off-by: Sage Weil (cherry picked from commit 45e79a17a932192995f8328ae9f6e8a2a6348d10) --- src/include/ceph_features.h | 2 ++ src/osd/PG.cc | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/include/ceph_features.h b/src/include/ceph_features.h index d6c7d6f5f2ff9..6b2a5fb50532b 100644 --- a/src/include/ceph_features.h +++ b/src/include/ceph_features.h @@ -51,6 +51,7 @@ #define CEPH_FEATURE_CRUSH_TUNABLES3 (1ULL<<41) #define CEPH_FEATURE_OSD_PRIMARY_AFFINITY (1ULL<<41) /* overlap w/ tunables3 */ #define CEPH_FEATURE_MSGR_KEEPALIVE2 (1ULL<<42) +#define CEPH_FEATURE_OSD_POOLRESEND (1ULL<<43) /* * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature @@ -122,6 +123,7 @@ static inline unsigned long long ceph_sanitize_features(unsigned long long f) { CEPH_FEATURE_CRUSH_TUNABLES3 | \ CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \ CEPH_FEATURE_MSGR_KEEPALIVE2 | \ + CEPH_FEATURE_OSD_POOLRESEND | \ 0ULL) #define CEPH_FEATURES_SUPPORTED_DEFAULT CEPH_FEATURES_ALL diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 6deb0998b2966..69813a4130660 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4938,6 +4938,13 @@ bool PG::can_discard_op(OpRequestRef op) return true; } + if (m->get_map_epoch() < pool.info.last_force_op_resend && + m->get_connection()->has_feature(CEPH_FEATURE_OSD_POOLRESEND)) { + dout(7) << __func__ << " sent before last_force_op_resend " + << pool.info.last_force_op_resend << ", dropping" << *m << dendl; + return true; + } + if ((m->get_flags() & (CEPH_OSD_FLAG_BALANCE_READS | CEPH_OSD_FLAG_LOCALIZE_READS)) && op->may_read() && -- 2.39.5