Merge pull request #6827 from trociny/wip-scrub-debug

Little improvements for troubleshooting scrub issues

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2015-12-11 23:28:11 +08:00
commit dc27e43bf8
3 changed files with 13 additions and 5 deletions

View File

@ -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;
}

View File

@ -6673,6 +6673,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");

View File

@ -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);