]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG::search_for_missing: minor refactoring, comment
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 3 Nov 2010 00:49:37 +0000 (17:49 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 10 Nov 2010 19:46:28 +0000 (11:46 -0800)
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
src/osd/PG.cc

index 1637f13d679b90f5d378bd742a078fb2b6cce598..9e98fcaa42ee77dc973fef5159506c8d4d59ec23 100644 (file)
@@ -512,28 +512,32 @@ void PG::merge_log(ObjectStore::Transaction& t,
 /*
  * process replica's missing map to determine if they have
  * any objects that i need
+ *
+ * TODO: if the missing set becomes very large, this could get expensive.
+ * Instead, we probably want to just iterate over our unfound set.
  */
 void PG::search_for_missing(Log &olog, Missing &omissing, int fromosd)
 {
   // found items?
   for (map<sobject_t,Missing::item>::iterator p = missing.missing.begin();
        p != missing.missing.end();
-       p++) {
+       ++p) {
     eversion_t need = p->second.need;
     eversion_t have = p->second.have;
     if (omissing.is_missing(p->first)) {
       dout(10) << "search_for_missing " << p->first << " " << need
               << " also missing on osd" << fromosd << dendl;
+      continue;
     } 
-    else if (need <= olog.head) {
-      dout(10) << "search_for_missing " << p->first << " " << need
-               << " is on osd" << fromosd << dendl;
-      missing_loc[p->first].insert(fromosd);
-    } else {
+    if (need > olog.head) {
       dout(10) << "search_for_missing " << p->first << " " << need
                << " > olog.head " << olog.head << ", also missing on osd" << fromosd
                << dendl;
+      continue;
     }
+    dout(10) << "search_for_missing " << p->first << " " << need
+            << " is on osd" << fromosd << dendl;
+    missing_loc[p->first].insert(fromosd);
   }
 
   dout(20) << "search_for_missing missing " << missing.missing << dendl;