]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: move scrub no good auth check out of helper
authorSage Weil <sage@redhat.com>
Wed, 10 Dec 2014 00:27:50 +0000 (16:27 -0800)
committerSage Weil <sage@redhat.com>
Sat, 20 Dec 2014 15:30:00 +0000 (07:30 -0800)
This helps call out that this is an exceptional case and simplifies the
helper a bit.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PGBackend.cc

index 60cc40c9afb1f080a62e2a39fc375b45319826b0..4491b3eb4341f65d0bd8d67d02f8a205c8d86446 100644 (file)
@@ -453,17 +453,6 @@ map<pg_shard_t, ScrubMap *>::const_iterator
     if (i == j->second->objects.end()) {
       continue;
     }
-    if (auth == maps.end()) {
-      // Something is better than nothing
-      // TODO: something is NOT better than nothing, do something like
-      // unfound_lost if no valid copies can be found, or just mark unfound
-      auth = j;
-      dout(10) << __func__ << ": selecting osd " << j->first
-              << " for obj " << obj
-              << ", auth == maps.end()"
-              << dendl;
-      continue;
-    }
     if (i->second.read_error) {
       // scrub encountered read error, probably corrupt
       dout(10) << __func__ << ": rejecting osd " << j->first
@@ -541,6 +530,18 @@ void PGBackend::be_compare_scrubmaps(
        ++k) {
     map<pg_shard_t, ScrubMap *>::const_iterator auth =
       be_select_auth_object(*k, maps);
+    if (auth == maps.end()) {
+      // Something is better than nothing
+      // TODO: something is NOT better than nothing, do something like
+      // unfound_lost if no valid copies can be found, or just mark unfound
+      auth = j;
+      dout(10) << __func__ << ": selecting osd " << j->first
+              << " for obj " << *k
+              << ", something is better than nothing, FIXME"
+              << dendl;
+      continue;
+    }
+
     assert(auth != maps.end());
     set<pg_shard_t> cur_missing;
     set<pg_shard_t> cur_inconsistent;