From 15b24058bcabe1345c061e8c4aff59e98e0333b0 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Fri, 4 Dec 2015 20:58:34 +0200 Subject: [PATCH 1/3] osd: use hexdump when logging CRC values Signed-off-by: Mykola Golub --- src/osd/ReplicatedBackend.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 8e7b757f29e..6d33c01b948 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -818,8 +818,9 @@ void ReplicatedBackend::be_deep_scrub( } ++keys_scanned; - dout(25) << "CRC key " << iter->key() << " value " - << string(iter->value().c_str(), iter->value().length()) << dendl; + dout(25) << "CRC key " << iter->key() << " value:\n"; + iter->value().hexdump(*_dout); + *_dout << dendl; ::encode(iter->key(), bl); ::encode(iter->value(), bl); From 9d88f1acb8c8a0891df0199705574fabb1ac6e96 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Fri, 4 Dec 2015 21:02:44 +0200 Subject: [PATCH 2/3] osd: more scrubber fields in pg query output Signed-off-by: Mykola Golub --- src/osd/PG.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index a4375cf927f..f6bba84b22d 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -6671,6 +6671,12 @@ boost::statechart::result PG::RecoveryState::Active::react(const QueryState& q) q.f->open_object_section("scrub"); q.f->dump_stream("scrubber.epoch_start") << pg->scrubber.epoch_start; q.f->dump_int("scrubber.active", pg->scrubber.active); + q.f->dump_string("scrubber.state", Scrubber::state_string(pg->scrubber.state)); + q.f->dump_stream("scrubber.start") << pg->scrubber.start; + 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_int("scrubber.seed", pg->scrubber.seed); q.f->dump_int("scrubber.waiting_on", pg->scrubber.waiting_on); { q.f->open_array_section("scrubber.waiting_on_whom"); From a828a4df54f040a39f54c4cdecde234376301be5 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Mon, 7 Dec 2015 08:53:23 +0200 Subject: [PATCH 3/3] osd: fix arithmetic exception when scrub_min_interval is small Signed-off-by: Mykola Golub --- src/osd/OSD.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 7425cc7e6b6..766dedfb9e5 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -6088,9 +6088,10 @@ OSDService::ScrubJob::ScrubJob(const spg_t& pg, const utime_t& timestamp, pool_scrub_max_interval : g_conf->osd_scrub_max_interval; sched_time += scrub_min_interval; - if (g_conf->osd_scrub_interval_randomize_ratio > 0) { - sched_time += rand() % (int)(scrub_min_interval * - g_conf->osd_scrub_interval_randomize_ratio); + int divisor = scrub_min_interval * + g_conf->osd_scrub_interval_randomize_ratio; + if (divisor > 0) { + sched_time += rand() % divisor; } deadline += scrub_max_interval; }