]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: pass authoritative scrub map to _scrub
authorSamuel Just <sam.just@inktank.com>
Sun, 31 Mar 2013 07:00:27 +0000 (00:00 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 1 Apr 2013 16:38:11 +0000 (09:38 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc

index 242b6fcfddd09be047c8d85955bd79e1cc083ebd..4c24b6a970981f6f680db6c4f90295e9250c0cfb 100644 (file)
@@ -4371,6 +4371,10 @@ void PG::_compare_scrubmaps(const map<int,ScrubMap*> &maps,
 
 void PG::scrub_compare_maps() {
   dout(10) << "scrub_compare_maps has maps, analyzing" << dendl;
+
+  // construct authoritative scrub map for type specific scrubbing
+  ScrubMap authmap(scrubber.primary_scrubmap);
+
   if (acting.size() > 1) {
     dout(10) << "scrub  comparing replica scrub maps" << dendl;
 
@@ -4410,10 +4414,17 @@ void PG::scrub_compare_maps() {
          i->first,
          make_pair(maps[i->second]->objects[i->first], i->second)));
     }
+
+    for (map<hobject_t, int>::iterator i = authoritative.begin();
+        i != authoritative.end();
+        ++i) {
+      authmap.objects.erase(i->first);
+      authmap.objects.insert(*(maps[i->second]->objects.find(i->first)));
+    }
   }
 
   // ok, do the pg-type specific scrubbing
-  _scrub(scrubber.primary_scrubmap);
+  _scrub(authmap);
 }
 
 void PG::scrub_process_inconsistent() {