]> 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>
Sat, 10 May 2014 16:12:26 +0000 (09:12 -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>
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 3e237c32f80bf0b65e1b201c3799f7fc8a9f8f87..40fcce966a9d7470b9124d26f3d8d2ca46fc0017 100644 (file)
@@ -4939,6 +4939,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() &&