]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: discard client ops sent before last_force_op_resend
authorSage Weil <sage@inktank.com>
Thu, 8 May 2014 17:50:51 +0000 (10:50 -0700)
committerSage Weil <sage@inktank.com>
Mon, 19 May 2014 20:54:03 +0000 (13:54 -0700)
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 <sage@inktank.com>
(cherry picked from commit 45e79a17a932192995f8328ae9f6e8a2a6348d10)

src/include/ceph_features.h
src/osd/PG.cc

index d6c7d6f5f2ff9893d3150c1f52794b2ec7307d53..6b2a5fb50532b23e09953a4fbb262cfeeb63e968 100644 (file)
@@ -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
index 6deb0998b296658762ce7eedfdace7829c5a5d0a..69813a4130660ddd87284433f006dfa1a7a2bf45 100644 (file)
@@ -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() &&