]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: scrub: share auth oi with caller and be_compare_scrub_objects
authorSage Weil <sage@redhat.com>
Wed, 10 Dec 2014 00:28:52 +0000 (16:28 -0800)
committerSage Weil <sage@redhat.com>
Sat, 20 Dec 2014 15:30:01 +0000 (07:30 -0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PGBackend.cc
src/osd/PGBackend.h

index 4491b3eb4341f65d0bd8d67d02f8a205c8d86446..d931c79d35b9050128024b7088085974b3eccb1b 100644 (file)
@@ -371,7 +371,9 @@ void PGBackend::be_scan_list(
 }
 
 enum scrub_error_type PGBackend::be_compare_scrub_objects(
+  pg_shard_t auth_shard,
   const ScrubMap::object &auth,
+  const object_info_t& auth_oi,
   const ScrubMap::object &candidate,
   ostream &errorstream)
 {
@@ -442,7 +444,8 @@ enum scrub_error_type PGBackend::be_compare_scrub_objects(
 map<pg_shard_t, ScrubMap *>::const_iterator
   PGBackend::be_select_auth_object(
   const hobject_t &obj,
-  const map<pg_shard_t,ScrubMap*> &maps)
+  const map<pg_shard_t,ScrubMap*> &maps,
+  object_info_t *auth_oi)
 {
   map<pg_shard_t, ScrubMap *>::const_iterator auth = maps.end();
   for (map<pg_shard_t, ScrubMap *>::const_iterator j = maps.begin();
@@ -498,6 +501,7 @@ map<pg_shard_t, ScrubMap *>::const_iterator
     dout(10) << __func__ << ": selecting osd " << j->first
             << " for obj " << obj
             << dendl;
+    *auth_oi = oi;
     auth = j;
   }
   return auth;
@@ -528,8 +532,9 @@ void PGBackend::be_compare_scrubmaps(
   for (set<hobject_t>::const_iterator k = master_set.begin();
        k != master_set.end();
        ++k) {
+    object_info_t auth_oi;
     map<pg_shard_t, ScrubMap *>::const_iterator auth =
-      be_select_auth_object(*k, maps);
+      be_select_auth_object(*k, maps, &auth_oi);
     if (auth == maps.end()) {
       // Something is better than nothing
       // TODO: something is NOT better than nothing, do something like
@@ -551,9 +556,12 @@ void PGBackend::be_compare_scrubmaps(
       if (j->second->objects.count(*k)) {
        // Compare
        stringstream ss;
-       enum scrub_error_type error = be_compare_scrub_objects(auth->second->objects[*k],
-           j->second->objects[*k],
-           ss);
+       enum scrub_error_type error =
+         be_compare_scrub_objects(auth->first,
+                                  auth->second->objects[*k],
+                                  auth_oi,
+                                  j->second->objects[*k],
+                                  ss);
         if (error != CLEAN) {
          cur_inconsistent.insert(j->first);
           if (error == SHALLOW_ERROR)
index c829b9468a619c157241f097c5e14ea9bc6dd532..561d512c740e1c4880e8278477b9adb35de7f441 100644 (file)
      ScrubMap &map, const vector<hobject_t> &ls, bool deep, uint32_t seed,
      ThreadPool::TPHandle &handle);
    enum scrub_error_type be_compare_scrub_objects(
+     pg_shard_t auth_shard,
      const ScrubMap::object &auth,
+     const object_info_t& auth_oi,
      const ScrubMap::object &candidate,
      ostream &errorstream);
    map<pg_shard_t, ScrubMap *>::const_iterator be_select_auth_object(
      const hobject_t &obj,
-     const map<pg_shard_t,ScrubMap*> &maps);
+     const map<pg_shard_t,ScrubMap*> &maps,
+     object_info_t *auth_oi);
    void be_compare_scrubmaps(
      const map<pg_shard_t,ScrubMap*> &maps,
      map<hobject_t, set<pg_shard_t> > &missing,