]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: introduce last_force_resend_prenautilus
authorSage Weil <sage@redhat.com>
Fri, 6 Apr 2018 16:24:02 +0000 (11:24 -0500)
committerSage Weil <sage@redhat.com>
Fri, 7 Sep 2018 17:08:40 +0000 (12:08 -0500)
Previously, we renamed the old last_force_resend to
last_force_resend_preluminous and created a new last_force_resend for
luminous+.  This allowed us to force preluminous clients to resend ops
(because they didn't understand the new pg split => new interval rule)
without affecting luminous clients.

Do the same rename again, adding a last_force_resend_prenautilus (luminous
or mimic).

Adjust the OSD code accordingly so it matches the behavior we'll see from
a luminous client.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/osd_types.cc
src/osd/osd_types.h

index 5f7ea5573c3997c0f87d300970be6e63fb30a7f2..fa4a197d7dfa917bed0089de6f03b41ac2821683 100644 (file)
@@ -6255,10 +6255,23 @@ bool PG::can_discard_op(OpRequestRef& op)
   }
 
   if (m->get_connection()->has_feature(CEPH_FEATURE_RESEND_ON_SPLIT)) {
-    if (m->get_map_epoch() < pool.info.get_last_force_op_resend()) {
-      dout(7) << __func__ << " sent before last_force_op_resend "
-             << pool.info.last_force_op_resend << ", dropping" << *m << dendl;
-      return true;
+    // >= luminous client
+    if (m->get_connection()->has_feature(CEPH_FEATURE_SERVER_NAUTILUS)) {
+      // >= nautilus client
+      if (m->get_map_epoch() < pool.info.get_last_force_op_resend()) {
+       dout(7) << __func__ << " sent before last_force_op_resend "
+               << pool.info.last_force_op_resend
+               << ", dropping" << *m << dendl;
+       return true;
+      }
+    } else {
+      // == < nautilus client (luminous or mimic)
+      if (m->get_map_epoch() < pool.info.get_last_force_op_resend_prenautilus()) {
+       dout(7) << __func__ << " sent before last_force_op_resend_prenautilus "
+               << pool.info.last_force_op_resend_prenautilus
+               << ", dropping" << *m << dendl;
+       return true;
+      }
     }
     if (m->get_map_epoch() < info.history.last_epoch_split) {
       dout(7) << __func__ << " pg split in "
@@ -6266,6 +6279,7 @@ bool PG::can_discard_op(OpRequestRef& op)
       return true;
     }
   } else if (m->get_connection()->has_feature(CEPH_FEATURE_OSD_POOLRESEND)) {
+    // < luminous client
     if (m->get_map_epoch() < pool.info.get_last_force_op_resend_preluminous()) {
       dout(7) << __func__ << " sent before last_force_op_resend_preluminous "
              << pool.info.last_force_op_resend_preluminous
index 28257b03c6b993ba3d7be6fec52e3b615a906b68..d1d21c999be0d72ee8a69018655fdc3a8e9187e3 100644 (file)
@@ -1222,6 +1222,8 @@ void pg_pool_t::dump(Formatter *f) const
   f->dump_unsigned("pg_num_pending_dec_epoch", get_pg_num_pending_dec_epoch());
   f->dump_stream("last_change") << get_last_change();
   f->dump_stream("last_force_op_resend") << get_last_force_op_resend();
+  f->dump_stream("last_force_op_resend_prenautilus")
+    << get_last_force_op_resend_prenautilus();
   f->dump_stream("last_force_op_resend_preluminous")
     << get_last_force_op_resend_preluminous();
   f->dump_unsigned("auid", get_auid());
@@ -1707,7 +1709,7 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
     encode(opts, bl);
   }
   if (v >= 25) {
-    encode(last_force_op_resend, bl);
+    encode(last_force_op_resend_prenautilus, bl);
   }
   if (v >= 26) {
     encode(application_metadata, bl);
@@ -1720,6 +1722,7 @@ void pg_pool_t::encode(bufferlist& bl, uint64_t features) const
     encode(pgp_num_target, bl);
     encode(pg_num_pending, bl);
     encode(pg_num_pending_dec_epoch, bl);
+    encode(last_force_op_resend, bl);
   }
   ENCODE_FINISH(bl);
 }
@@ -1869,9 +1872,9 @@ void pg_pool_t::decode(bufferlist::const_iterator& bl)
     decode(opts, bl);
   }
   if (struct_v >= 25) {
-    decode(last_force_op_resend, bl);
+    decode(last_force_op_resend_prenautilus, bl);
   } else {
-    last_force_op_resend = last_force_op_resend_preluminous;
+    last_force_op_resend_prenautilus = last_force_op_resend_preluminous;
   }
   if (struct_v >= 26) {
     decode(application_metadata, bl);
@@ -1884,10 +1887,12 @@ void pg_pool_t::decode(bufferlist::const_iterator& bl)
     decode(pgp_num_target, bl);
     decode(pg_num_pending, bl);
     decode(pg_num_pending_dec_epoch, bl);
+    decode(last_force_op_resend, bl);
   } else {
     pg_num_target = pg_num;
     pgp_num_target = pgp_num;
     pg_num_pending = pg_num;
+    last_force_op_resend = last_force_op_resend_prenautilus;
   }
   DECODE_FINISH(bl);
   calc_pg_masks();
@@ -1984,8 +1989,10 @@ ostream& operator<<(ostream& out, const pg_pool_t& p)
   }
   out << " last_change " << p.get_last_change();
   if (p.get_last_force_op_resend() ||
+      p.get_last_force_op_resend_prenautilus() ||
       p.get_last_force_op_resend_preluminous())
     out << " lfor " << p.get_last_force_op_resend() << "/"
+       << p.get_last_force_op_resend_prenautilus() << "/"
        << p.get_last_force_op_resend_preluminous();
   if (p.get_auid())
     out << " owner " << p.get_auid();
index b9cec21739eb595f6af18e4b1aa9e3dd756122da..530f4689a69168e46fd744db9479f010c44288ff 100644 (file)
@@ -1336,9 +1336,14 @@ public:
   map<string,string> properties;  ///< OBSOLETE
   string erasure_code_profile; ///< name of the erasure code profile in OSDMap
   epoch_t last_change;      ///< most recent epoch changed, exclusing snapshot changes
-  epoch_t last_force_op_resend; ///< last epoch that forced clients to resend
+
+  /// last epoch that forced clients to resend
+  epoch_t last_force_op_resend = 0;
+  /// last epoch that forced clients to resend (pre-nautilus clients only)
+  epoch_t last_force_op_resend_prenautilus = 0;
   /// last epoch that forced clients to resend (pre-luminous clients only)
-  epoch_t last_force_op_resend_preluminous;
+  epoch_t last_force_op_resend_preluminous = 0;
+
   epoch_t pg_num_pending_dec_epoch = 0;  ///< epoch pg_num_pending decremented
   snapid_t snap_seq;        ///< seq for per-pool snapshot
   epoch_t snap_epoch;       ///< osdmap epoch of last snap
@@ -1454,8 +1459,6 @@ public:
     : flags(0), type(0), size(0), min_size(0),
       crush_rule(0), object_hash(0),
       last_change(0),
-      last_force_op_resend(0),
-      last_force_op_resend_preluminous(0),
       snap_seq(0), snap_epoch(0),
       auid(0),
       quota_max_bytes(0), quota_max_objects(0),
@@ -1509,6 +1512,9 @@ public:
   }
   epoch_t get_last_change() const { return last_change; }
   epoch_t get_last_force_op_resend() const { return last_force_op_resend; }
+  epoch_t get_last_force_op_resend_prenautilus() const {
+    return last_force_op_resend_prenautilus;
+  }
   epoch_t get_last_force_op_resend_preluminous() const {
     return last_force_op_resend_preluminous;
   }
@@ -1609,6 +1615,7 @@ public:
 
   void set_last_force_op_resend(uint64_t t) {
     last_force_op_resend = t;
+    last_force_op_resend_prenautilus = t;
     last_force_op_resend_preluminous = t;
   }