From 2d34e380c8df465bfb3968fd10550285faa4a9b9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 11 Jan 2018 16:37:00 -0600 Subject: [PATCH] osd/PG: drop 'seed' property from Scrubber This has been -1 for many releases now. Signed-off-by: Sage Weil --- src/messages/MOSDRepScrub.h | 15 +++++++-------- src/osd/ECBackend.cc | 4 ++-- src/osd/PG.cc | 18 ++++++------------ src/osd/PG.h | 6 ++---- src/osd/ReplicatedBackend.cc | 4 ++-- src/osd/osd_types.h | 1 - 6 files changed, 19 insertions(+), 29 deletions(-) diff --git a/src/messages/MOSDRepScrub.h b/src/messages/MOSDRepScrub.h index 35d1b3e9fee6..3bd73fb28ae4 100644 --- a/src/messages/MOSDRepScrub.h +++ b/src/messages/MOSDRepScrub.h @@ -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 { diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index dfb75a6c3d7b..a5d9736b8817 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -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; } diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 8d8f7714d7e2..65caaf1718e2 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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( "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::iterator p = pg->scrubber.waiting_on_whom.begin(); diff --git a/src/osd/PG.h b/src/osd/PG.h index 5bf41c6e039f..11718ba0ec82 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1516,7 +1516,6 @@ public: std::unique_ptr 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 diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 769ff5ae1321..de0175f6c0e8 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -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( diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 98af6243a96e..01fe049df27e 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -4962,7 +4962,6 @@ WRITE_CLASS_ENCODER(ScrubMap) struct ScrubMapBuilder { bool deep = false; - uint32_t seed = 0; vector ls; size_t pos = 0; int64_t data_pos = 0; -- 2.47.3