From: David Zafman Date: Wed, 15 May 2013 02:22:18 +0000 (-0700) Subject: OSD: After repairs finish a new deep-scrub should be avoided X-Git-Tag: v0.64~122^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3759daa9c41f274f2834ed57f8c58f9ab6a725d7;p=ceph.git OSD: After repairs finish a new deep-scrub should be avoided When errors fixed, clear them so pg not inconsistent and no deep-scrub needed In the rare case of incomplete repair, still do deep-scrub to get new error counts fixes: #4783 Signed-off-by: David Zafman --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 4aac5301ab9..fdc5701bc87 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4611,7 +4611,6 @@ void PG::scrub_process_inconsistent() { osd->clog.error(ss); if (repair) { state_clear(PG_STATE_CLEAN); - scrub_after_recovery = true; for (map >::iterator i = scrubber.authoritative.begin(); i != scrubber.authoritative.end(); @@ -4716,6 +4715,17 @@ void PG::scrub_finish() { info.history.last_deep_scrub = info.last_update; info.history.last_deep_scrub_stamp = now; } + // Since we don't know which errors were fixed, we can only clear them + // when every one has been fixed. + if (repair) { + if (scrubber.fixed == scrubber.shallow_errors + scrubber.deep_errors) { + assert(deep_scrub); + scrubber.shallow_errors = scrubber.deep_errors = 0; + } else { + // Deep scrub in order to get corrected error counts + scrub_after_recovery = true; + } + } if (deep_scrub) { if ((scrubber.shallow_errors == 0) && (scrubber.deep_errors == 0)) info.history.last_clean_scrub_stamp = now;