]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: based INCONSISTENT pg state on persistent scrub errors
authorSage Weil <sage@inktank.com>
Tue, 15 Jan 2013 02:21:46 +0000 (18:21 -0800)
committerSage Weil <sage@inktank.com>
Tue, 15 Jan 2013 03:20:53 +0000 (19:20 -0800)
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 <sage@inktank.com>
src/osd/PG.cc

index db5171a531e21c425c9212afac60153cd368e094..572962a81de7491746369232263149f4fe62db8a 100644 (file)
@@ -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<hobject_t, pair<ScrubMap::object, int> >::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 << " ";