]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: encode all_participants for pi_compact
authorSage Weil <sage@redhat.com>
Mon, 17 Apr 2017 16:47:49 +0000 (12:47 -0400)
committerSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 15:32:17 +0000 (11:32 -0400)
The all_participants is only updated on add_interval and
cannot be rebuilt from the intervals vector alone since
we only keep the smallset subset of peers to probe that
we need.  And it wasn't being encoded/decoded.  Or
dumped.

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

index f0d9deb73d027ab1d63ab7e6d6228d5ac93ada7a..b17670cb4515e686599019ed25b5b3de86226844 100644 (file)
@@ -3099,7 +3099,6 @@ class pi_compact_rep : public PastIntervals::interval_rep {
   epoch_t first = 0;
   epoch_t last = 0; // inclusive
   set<pg_shard_t> all_participants;
-
   list<compact_interval_t> intervals;
   pi_compact_rep(
     bool ec_pool,
@@ -3169,6 +3168,7 @@ public:
     ENCODE_START(1, 1, bl);
     ::encode(first, bl);
     ::encode(last, bl);
+    ::encode(all_participants, bl);
     ::encode(intervals, bl);
     ENCODE_FINISH(bl);
   }
@@ -3176,6 +3176,7 @@ public:
     DECODE_START(1, bl);
     ::decode(first, bl);
     ::decode(last, bl);
+    ::decode(all_participants, bl);
     ::decode(intervals, bl);
     DECODE_FINISH(bl);
   }
@@ -3183,6 +3184,11 @@ public:
     f->open_object_section("PastIntervals::compact_rep");
     f->dump_stream("first") << first;
     f->dump_stream("last") << last;
+    f->open_array_section("all_participants");
+    for (auto& i : all_participants) {
+      f->dump_object("pg_shard", i);
+    }
+    f->close_section();
     f->open_array_section("intervals");
     for (auto &&i: intervals) {
       i.dump(f);
index 965c099f1000991e55657fe154bd565caaccd7ef..dcbce601dd02f17ad999d7074045725635ec356d 100644 (file)
@@ -139,6 +139,12 @@ struct pg_shard_t {
   }
   void encode(bufferlist &bl) const;
   void decode(bufferlist::iterator &bl);
+  void dump(Formatter *f) const {
+    f->dump_unsigned("osd", osd);
+    if (shard != shard_id_t::NO_SHARD) {
+      f->dump_unsigned("shard", shard);
+    }
+  }
 };
 WRITE_CLASS_ENCODER(pg_shard_t)
 WRITE_EQ_OPERATORS_2(pg_shard_t, osd, shard)
@@ -2898,6 +2904,7 @@ PastIntervals::PriorSet::PriorSet(
   }
 
   set<pg_shard_t> all_probe = past_intervals.get_all_probe(ec_pool);
+  ldpp_dout(dpp, 10) << "build_prior all_probe " << all_probe << dendl;
   for (auto &&i: all_probe) {
     switch (f(0, i.osd, nullptr)) {
     case UP: {
@@ -2963,8 +2970,8 @@ PastIntervals::PriorSet::PriorSet(
       // ensure that we haven't lost any information.
       if (!(*pcontdec)(up_now) && any_down_now) {
        // fixme: how do we identify a "clean" shutdown anyway?
-       ldpp_dout(dpp, 10) << "build_prior  possibly went active+rw, insufficient up;"
-                          << " including down osds" << dendl;
+       ldpp_dout(dpp, 10) << "build_prior  possibly went active+rw,"
+                          << " insufficient up; including down osds" << dendl;
        assert(!candidate_blocked_by.empty());
        pg_down = true;
        blocked_by.insert(