From: Sage Weil Date: Tue, 23 Nov 2010 20:46:51 +0000 (-0800) Subject: osd: only search_for_missing if there are unfound objects X-Git-Tag: v0.24~122 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=413ecb0bcf48469a73d319d0101793d8fa1f0ff5;p=ceph.git osd: only search_for_missing if there are unfound objects Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 8b80b3dc0489..a2d49f11a562 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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 > 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); diff --git a/src/osd/PG.h b/src/osd/PG.h index e48942bda6a6..84283efe5257 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -849,6 +849,10 @@ public: void activate(ObjectStore::Transaction& t, list& tfin, map *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;