]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: drop 'seed' property from Scrubber 18971/head
authorSage Weil <sage@redhat.com>
Thu, 11 Jan 2018 22:37:00 +0000 (16:37 -0600)
committerSage Weil <sage@redhat.com>
Wed, 17 Jan 2018 03:52:09 +0000 (21:52 -0600)
This has been -1 for many releases now.

Signed-off-by: Sage Weil <sage@redhat.com>
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 35d1b3e9fee685ec27a7d46cf2091703c59d0ad8..3bd73fb28ae461ef052a6ada99cf3afcd934d580 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
        << ")";
@@ -100,7 +96,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);
   }
@@ -115,7 +111,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 dfb75a6c3d7ba94cee359a1ca2818bebd3edf98f..a5d9736b88176f86e743a346240ea50ed378a5ac 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 8d8f7714d7e22ea0492d025cb6b3087b586310b5..65caaf1718e226df6884e9e5112657bbb4c71d84 100644 (file)
@@ -1040,8 +1040,7 @@ PG::Scrubber::Scrubber()
    auto_repair(false),
    num_digest_updates_pending(0),
    state(INACTIVE),
-   deep(false),
-   seed(0)
+   deep(false)
 {}
 
 PG::Scrubber::~Scrubber() {}
@@ -3876,17 +3875,17 @@ void PG::do_replica_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!)
@@ -4201,7 +4200,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 << ") "
@@ -4211,7 +4209,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();
 
@@ -4577,7 +4574,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;
@@ -4697,7 +4693,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);
         }
@@ -4741,7 +4736,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();
@@ -4844,7 +4839,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) {
@@ -7703,7 +7698,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 5bf41c6e039f12a903ceeb9aaae21bc7f09ce165..11718ba0ec82c2d01511c9fcf039724dfbf906c6 100644 (file)
@@ -1516,7 +1516,6 @@ public:
     std::unique_ptr<Scrub::Store> store;
     // deep scrub
     bool deep;
-    uint32_t seed;
     int preempt_left;
     int preempt_divisor;
 
@@ -1578,7 +1577,6 @@ public:
       large_omap_objects = 0;
       fixed = 0;
       deep = false;
-      seed = 0;
       run_callbacks();
       inconsistent.clear();
       missing.clear();
@@ -1631,11 +1629,11 @@ protected:
     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 769ff5ae1321de5499fb2cc9287598fdd6a09949..de0175f6c0e897a64641d2b68cd544999fa8ad86 100644 (file)
@@ -675,7 +675,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;
@@ -713,7 +713,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 98af6243a96e0f16f14af2d0cefc518217f11bac..01fe049df27e5f12b946c5afd72a998bc5f08501 100644 (file)
@@ -4962,7 +4962,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;