]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: only search_for_missing if there are unfound objects
authorSage Weil <sage@newdream.net>
Tue, 23 Nov 2010 20:46:51 +0000 (12:46 -0800)
committerSage Weil <sage@newdream.net>
Tue, 23 Nov 2010 21:52:22 +0000 (13:52 -0800)
Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSD.cc
src/osd/PG.h

index 8b80b3dc04891fedb1e19b77509dd3500faf9062..a2d49f11a562da6ba31293d2ded8f563c9544e27 100644 (file)
@@ -3795,7 +3795,7 @@ void OSD::handle_pg_notify(MOSDPGNotify *m)
       pg->update_stats();
     }
 
-    if (pg->is_active() && pg->missing.have_missing()) {
+    if (pg->is_active() && pg->have_unfound()) {
       // Make sure we've requested MISSING information from every OSD
       // we know about.
       map< int, map<pg_t,PG::Query> > query_map;
@@ -3906,7 +3906,7 @@ void OSD::_process_pg_info(epoch_t epoch, int from,
     // i am PRIMARY
     if (pg->is_active())  {
       // PG is ACTIVE
-      if (pg->missing.have_missing()) {
+      if (pg->have_unfound()) {
        dout(10) << *pg << " searching osd" << from << " log for missing items." << dendl;
        pg->search_for_missing(info, missing, from);
 
index e48942bda6a6201f72f46163a5a58023bddfafc0..84283efe52575ea346aa75a6b28f14289b9f884a 100644 (file)
@@ -849,6 +849,10 @@ public:
   void activate(ObjectStore::Transaction& t, list<Context*>& tfin,
                map<int, MOSDPGInfo*> *activator_map=0);
 
+  bool have_unfound() const { 
+    return missing.num_missing() > missing_loc.size();
+  }
+
   virtual void clean_up_local(ObjectStore::Transaction& t) = 0;
 
   virtual int start_recovery_ops(int max) = 0;