From: Sage Weil Date: Tue, 15 Jan 2013 02:21:46 +0000 (-0800) Subject: osd: based INCONSISTENT pg state on persistent scrub errors X-Git-Tag: v0.57~200 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2baf1253eed630a7c4ae4cb43aab6475efd82425;p=ceph.git osd: based INCONSISTENT pg state on persistent scrub errors This makes the state persistent across PG peering and OSD restarts. This has the side-effect that, on recovery, we rescrub any PGs marked inconsistent. This is new behavior! Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index db5171a531e2..572962a81de7 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2190,6 +2190,11 @@ void PG::update_stats() info.stats.last_clean_scrub_stamp = info.history.last_clean_scrub_stamp; info.stats.last_epoch_clean = info.history.last_epoch_clean; + if (info.stats.stats.sum.num_scrub_errors) + state_set(PG_STATE_INCONSISTENT); + else + state_clear(PG_STATE_INCONSISTENT); + utime_t now = ceph_clock_now(g_ceph_context); info.stats.last_fresh = now; if (info.stats.state != state) { @@ -4202,7 +4207,6 @@ void PG::scrub_process_inconsistent() { << scrubber.inconsistent.size() << " inconsistent objects\n"; dout(2) << ss.str() << dendl; osd->clog.error(ss); - state_set(PG_STATE_INCONSISTENT); if (repair) { state_clear(PG_STATE_CLEAN); for (map >::iterator i = @@ -4280,9 +4284,6 @@ void PG::scrub_finish() { scrub_process_inconsistent(); - if (scrubber.errors == 0 || (repair && (scrubber.errors - scrubber.fixed) == 0)) - state_clear(PG_STATE_INCONSISTENT); - { stringstream oss; oss << info.pgid << " " << mode << " ";