]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: drop last_backfill_bitwise member 28766/head
authorSage Weil <sage@redhat.com>
Mon, 24 Jun 2019 15:23:22 +0000 (10:23 -0500)
committerSage Weil <sage@redhat.com>
Tue, 2 Jul 2019 15:49:08 +0000 (10:49 -0500)
Assert if we try to decode an info with it set to false.

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

index 771326a09f7dc69d12b48a8bc4790b8966a5c205..16df622d5aa09aa57e9a96cd0203c6d18baaf4e6 100644 (file)
@@ -3241,11 +3241,7 @@ void pg_info_t::encode(ceph::buffer::list &bl) const
   encode(last_update, bl);
   encode(last_complete, bl);
   encode(log_tail, bl);
-  if (last_backfill_bitwise && !last_backfill.is_max()) {
-    encode(hobject_t(), bl);
-  } else {
-    encode(last_backfill, bl);
-  }
+  encode(hobject_t(), bl);  // old (nibblewise) last_backfill
   encode(stats, bl);
   history.encode(bl);
   encode(purged_snaps, bl);
@@ -3254,7 +3250,7 @@ void pg_info_t::encode(ceph::buffer::list &bl) const
   encode(hit_set, bl);
   encode(pgid.shard, bl);
   encode(last_backfill, bl);
-  encode(last_backfill_bitwise, bl);
+  encode(true, bl); // was last_backfill_bitwise
   encode(last_interval_started, bl);
   ENCODE_FINISH(bl);
 }
@@ -3278,7 +3274,13 @@ void pg_info_t::decode(ceph::buffer::list::const_iterator &bl)
   decode(hit_set, bl);
   decode(pgid.shard, bl);
   decode(last_backfill, bl);
-  decode(last_backfill_bitwise, bl);
+  {
+    bool last_backfill_bitwise;
+    decode(last_backfill_bitwise, bl);
+    // note: we may see a false value here since the default value for
+    // the member was false, so it often didn't get set to true until
+    // peering progressed.
+  }
   if (struct_v >= 32) {
     decode(last_interval_started, bl);
   } else {
@@ -3297,7 +3299,6 @@ void pg_info_t::dump(Formatter *f) const
   f->dump_stream("log_tail") << log_tail;
   f->dump_int("last_user_version", last_user_version);
   f->dump_stream("last_backfill") << last_backfill;
-  f->dump_int("last_backfill_bitwise", (int)last_backfill_bitwise);
   f->open_array_section("purged_snaps");
   for (interval_set<snapid_t>::const_iterator i=purged_snaps.begin();
        i != purged_snaps.end();
@@ -3338,7 +3339,6 @@ void pg_info_t::generate_test_instances(list<pg_info_t*>& o)
   o.back()->last_user_version = 2;
   o.back()->log_tail = eversion_t(7, 8);
   o.back()->last_backfill = hobject_t(object_t("objname"), "key", 123, 456, -1, "");
-  o.back()->last_backfill_bitwise = true;
   {
     list<pg_stat_t*> s;
     pg_stat_t::generate_test_instances(s);
index f15f491db0217ccc74210b4ff6dcc4884eb4aade..bdad9f6e8a4641fa82ff01ccd198e9544cb74af1 100644 (file)
@@ -2756,7 +2756,6 @@ struct pg_info_t {
   eversion_t log_tail;         ///< oldest log entry.
 
   hobject_t last_backfill;     ///< objects >= this and < last_complete may be missing
-  bool last_backfill_bitwise;  ///< true if last_backfill reflects a bitwise (vs nibblewise) sort
 
   interval_set<snapid_t> purged_snaps;
 
@@ -2775,7 +2774,6 @@ struct pg_info_t {
       l.last_user_version == r.last_user_version &&
       l.log_tail == r.log_tail &&
       l.last_backfill == r.last_backfill &&
-      l.last_backfill_bitwise == r.last_backfill_bitwise &&
       l.purged_snaps == r.purged_snaps &&
       l.stats == r.stats &&
       l.history == r.history &&
@@ -2786,8 +2784,7 @@ struct pg_info_t {
     : last_epoch_started(0),
       last_interval_started(0),
       last_user_version(0),
-      last_backfill(hobject_t::get_max()),
-      last_backfill_bitwise(false)
+      last_backfill(hobject_t::get_max())
   { }
   // cppcheck-suppress noExplicitConstructor
   pg_info_t(spg_t p)
@@ -2795,13 +2792,11 @@ struct pg_info_t {
       last_epoch_started(0),
       last_interval_started(0),
       last_user_version(0),
-      last_backfill(hobject_t::get_max()),
-      last_backfill_bitwise(false)
+      last_backfill(hobject_t::get_max())
   { }
   
   void set_last_backfill(hobject_t pos) {
     last_backfill = pos;
-    last_backfill_bitwise = true;
   }
 
   bool is_empty() const { return last_update.version == 0; }
@@ -2831,8 +2826,7 @@ inline std::ostream& operator<<(std::ostream& out, const pg_info_t& pgi)
     out << " (" << pgi.log_tail << "," << pgi.last_update << "]";
   }
   if (pgi.is_incomplete())
-    out << " lb " << pgi.last_backfill
-       << (pgi.last_backfill_bitwise ? " (bitwise)" : " (NIBBLEWISE)");
+    out << " lb " << pgi.last_backfill;
   //out << " c " << pgi.epoch_created;
   out << " local-lis/les=" << pgi.last_interval_started
       << "/" << pgi.last_epoch_started;