]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: drop 'seed' property from Scrubber
authorSage Weil <sage@redhat.com>
Fri, 19 Jan 2018 19:59:56 +0000 (13:59 -0600)
committerDavid Zafman <dzafman@redhat.com>
Fri, 18 May 2018 16:37:56 +0000 (09:37 -0700)
This has been -1 for many releases now.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 2d34e380c8df465bfb3968fd10550285faa4a9b9)

Conflicts:
src/messages/MOSDRepScrub.h

- encode vs ::encode etc

src/messages/MOSDRepScrub.h
src/osd/ECBackend.cc
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedBackend.cc
src/osd/osd_types.h

index 63749e24f4cc9c542b9171f42ed1e5d26bce7b05..90b0746d6d64c75afd64f4be700a638fc17a6f13 100644 (file)
@@ -35,7 +35,6 @@ struct MOSDRepScrub : public MOSDFastDispatchOp {
   hobject_t start;       // lower bound of scrub, inclusive
   hobject_t end;         // upper bound of scrub, exclusive
   bool deep;             // true if scrub should be deep
-  uint32_t seed;         // seed value for digest calculation
   bool allow_preemption = false;
 
   epoch_t get_map_epoch() const override {
@@ -51,11 +50,10 @@ struct MOSDRepScrub : public MOSDFastDispatchOp {
   MOSDRepScrub()
     : MOSDFastDispatchOp(MSG_OSD_REP_SCRUB, HEAD_VERSION, COMPAT_VERSION),
       chunky(false),
-      deep(false),
-      seed(0) { }
+      deep(false) { }
 
   MOSDRepScrub(spg_t pgid, eversion_t scrub_to, epoch_t map_epoch, epoch_t min_epoch,
-               hobject_t start, hobject_t end, bool deep, uint32_t seed,
+               hobject_t start, hobject_t end, bool deep,
               bool preemption)
     : MOSDFastDispatchOp(MSG_OSD_REP_SCRUB, HEAD_VERSION, COMPAT_VERSION),
       pgid(pgid),
@@ -66,7 +64,6 @@ struct MOSDRepScrub : public MOSDFastDispatchOp {
       start(start),
       end(end),
       deep(deep),
-      seed(seed),
       allow_preemption(preemption) { }
 
 
@@ -83,7 +80,6 @@ public:
        << ",start:" << start << ",end:" << end
         << ",chunky:" << chunky
         << ",deep:" << deep
-       << ",seed:" << seed
         << ",version:" << header.version
        << ",allow_preemption:" << (int)allow_preemption
        << ")";
@@ -99,7 +95,7 @@ public:
     ::encode(end, payload);
     ::encode(deep, payload);
     ::encode(pgid.shard, payload);
-    ::encode(seed, payload);
+    ::encode((uint32_t)-1, payload); // seed
     ::encode(min_epoch, payload);
     ::encode(allow_preemption, payload);
   }
@@ -114,7 +110,10 @@ public:
     ::decode(end, p);
     ::decode(deep, p);
     ::decode(pgid.shard, p);
-    ::decode(seed, p);
+    {
+      uint32_t seed;
+      ::decode(seed, p);
+    }
     if (header.version >= 7) {
       ::decode(min_epoch, p);
     } else {
index 7ffd9997e5302857ed247732f9d2f549b7f47c4e..901f1ccd12b5c1c3ae835eaaf6e4f871888bb743 100644 (file)
@@ -2436,7 +2436,7 @@ int ECBackend::be_deep_scrub(
   sleeptime.set_from_double(cct->_conf->osd_debug_deep_scrub_sleep);
 
   if (pos.data_pos == 0) {
-    pos.data_hash = bufferhash(pos.seed);
+    pos.data_hash = bufferhash(-1);
   }
 
   uint64_t stride = cct->_conf->osd_deep_scrub_stride;
@@ -2518,7 +2518,7 @@ int ECBackend::be_deep_scrub(
     }
   }
 
-  o.omap_digest = pos.seed;
+  o.omap_digest = -1;
   o.omap_digest_present = true;
   return 0;
 }
index 2bca3b5a9ed3c72df643c4c1d1a2e0d0cddc1350..382eb2bf959dd11fce583ca806335a6e3728ae97 100644 (file)
@@ -1016,8 +1016,7 @@ PG::Scrubber::Scrubber()
    auto_repair(false),
    num_digest_updates_pending(0),
    state(INACTIVE),
-   deep(false),
-   seed(0)
+   deep(false)
 {}
 
 PG::Scrubber::~Scrubber() {}
@@ -3848,17 +3847,17 @@ void PG::sub_op_scrub_map(OpRequestRef op)
 void PG::_request_scrub_map(
   pg_shard_t replica, eversion_t version,
   hobject_t start, hobject_t end,
-  bool deep, uint32_t seed,
+  bool deep,
   bool allow_preemption)
 {
   assert(replica != pg_whoami);
   dout(10) << "scrub  requesting scrubmap from osd." << replica
-          << " deep " << (int)deep << " seed " << seed << dendl;
+          << " deep " << (int)deep << dendl;
   MOSDRepScrub *repscrubop = new MOSDRepScrub(
     spg_t(info.pgid.pgid, replica.shard), version,
     get_osdmap()->get_epoch(),
     get_last_peering_reset(),
-    start, end, deep, seed,
+    start, end, deep,
     allow_preemption);
   // default priority, we want the rep scrub processed prior to any recovery
   // or client io messages (we are holding a lock!)
@@ -4243,7 +4242,6 @@ int PG::build_scrub_map_chunk(
   hobject_t start,
   hobject_t end,
   bool deep,
-  uint32_t seed,
   ThreadPool::TPHandle &handle)
 {
   dout(10) << __func__ << " [" << start << "," << end << ") "
@@ -4253,7 +4251,6 @@ int PG::build_scrub_map_chunk(
   // start
   while (pos.empty()) {
     pos.deep = deep;
-    pos.seed = seed;
     map.valid_through = info.last_update;
     osr->flush();
 
@@ -4619,7 +4616,6 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
          osd->clog->debug(oss);
        }
 
-       scrubber.seed = -1;
        scrubber.preempt_left = cct->_conf->get_val<uint64_t>(
          "osd_scrub_max_preemptions");
        scrubber.preempt_divisor = 1;
@@ -4739,7 +4735,6 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
          if (*i == pg_whoami) continue;
           _request_scrub_map(*i, scrubber.subset_last_update,
                              scrubber.start, scrubber.end, scrubber.deep,
-                            scrubber.seed,
                             scrubber.preempt_left > 0);
           scrubber.waiting_on_whom.insert(*i);
         }
@@ -4783,7 +4778,7 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
          scrubber.primary_scrubmap,
          scrubber.primary_scrubmap_pos,
          scrubber.start, scrubber.end,
-         scrubber.deep, scrubber.seed,
+         scrubber.deep,
          handle);
        if (ret == -EINPROGRESS) {
          requeue_scrub();
@@ -4886,7 +4881,7 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
            scrubber.replica_scrubmap,
            scrubber.replica_scrubmap_pos,
            scrubber.start, scrubber.end,
-           scrubber.deep, scrubber.seed,
+           scrubber.deep,
            handle);
        }
        if (ret == -EINPROGRESS) {
@@ -7640,7 +7635,6 @@ boost::statechart::result PG::RecoveryState::Active::react(const QueryState& q)
     q.f->dump_stream("scrubber.end") << pg->scrubber.end;
     q.f->dump_stream("scrubber.subset_last_update") << pg->scrubber.subset_last_update;
     q.f->dump_bool("scrubber.deep", pg->scrubber.deep);
-    q.f->dump_unsigned("scrubber.seed", pg->scrubber.seed);
     {
       q.f->open_array_section("scrubber.waiting_on_whom");
       for (set<pg_shard_t>::iterator p = pg->scrubber.waiting_on_whom.begin();
index 7637912a54c8ab96847f77c5221b7f8499f23d5c..82a4b69c51e719c502b12c5de435974fb395bce0 100644 (file)
@@ -1274,7 +1274,6 @@ public:
     std::unique_ptr<Scrub::Store> store;
     // deep scrub
     bool deep;
-    uint32_t seed;
     int preempt_left;
     int preempt_divisor;
 
@@ -1336,7 +1335,6 @@ public:
       large_omap_objects = 0;
       fixed = 0;
       deep = false;
-      seed = 0;
       run_callbacks();
       inconsistent.clear();
       missing.clear();
@@ -1389,11 +1387,11 @@ public:
     ThreadPool::TPHandle &handle);
   void _request_scrub_map(pg_shard_t replica, eversion_t version,
                           hobject_t start, hobject_t end, bool deep,
-                         uint32_t seed, bool allow_preemption);
+                         bool allow_preemption);
   int build_scrub_map_chunk(
     ScrubMap &map,
     ScrubMapBuilder &pos,
-    hobject_t start, hobject_t end, bool deep, uint32_t seed,
+    hobject_t start, hobject_t end, bool deep,
     ThreadPool::TPHandle &handle);
   /**
    * returns true if [begin, end) is good to scrub at this time
index ba24c7a2639dff653bfa01e876344a27a24adba6..6e5d6f73ab5ec98042a03283f7b935894182ddb1 100644 (file)
@@ -727,7 +727,7 @@ int ReplicatedBackend::be_deep_scrub(
   assert(poid == pos.ls[pos.pos]);
   if (!pos.data_done()) {
     if (pos.data_pos == 0) {
-      pos.data_hash = bufferhash(pos.seed);
+      pos.data_hash = bufferhash(-1);
     }
 
     bufferlist bl;
@@ -765,7 +765,7 @@ int ReplicatedBackend::be_deep_scrub(
 
   // omap header
   if (pos.omap_pos.empty()) {
-    pos.omap_hash = bufferhash(pos.seed);
+    pos.omap_hash = bufferhash(-1);
 
     bufferlist hdrbl;
     r = store->omap_get_header(
index 6fd8b6646d0b111b9c822cd1011c6e9e93a3afcf..f7dfc4ec879f896ee77c83f0c390d0b59b48b907 100644 (file)
@@ -4988,7 +4988,6 @@ WRITE_CLASS_ENCODER(ScrubMap)
 
 struct ScrubMapBuilder {
   bool deep = false;
-  uint32_t seed = 0;
   vector<hobject_t> ls;
   size_t pos = 0;
   int64_t data_pos = 0;