]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: all_unfound_are_queried_or_lost
authorSage Weil <sage@newdream.net>
Thu, 13 Oct 2011 19:47:57 +0000 (12:47 -0700)
committerSage Weil <sage@newdream.net>
Sat, 15 Oct 2011 04:02:32 +0000 (21:02 -0700)
The check to make isn't whether all locations are lost, but whether all
locations are either lost or have been queried and don't have the object(s)
we want.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h

index 74c41711b2bee1928fa737bfc737370fb55cb6f6..15d97ef34f587d7dd47c99ca39491a94189028c3 100644 (file)
@@ -2381,7 +2381,7 @@ void OSD::do_command(Connection *con, tid_t tid, vector<string>& cmd, bufferlist
       r = -ENOENT;
       goto out;
     }
-    if (!pg->all_unfound_are_lost(pg->osd->osdmap)) {
+    if (!pg->all_unfound_are_queried_or_lost(pg->osd->osdmap)) {
       ss << "pg " << pgid << " has " << unfound
         << " objects but we haven't probed all sources, not marking lost despite command "
         << cmd;
index cad2d7681abdb5061531200b815adcaae5d7687c..3e5e5993ac0c05c75c37ed9769d92d5b99b084b8 100644 (file)
@@ -1060,13 +1060,15 @@ bool PG::adjust_need_up_thru(const OSDMap *osdmap)
 /*
  * Returns true unless there is a non-lost OSD in might_have_unfound.
  */
-bool PG::all_unfound_are_lost(const OSDMap* osdmap) const
+bool PG::all_unfound_are_queried_or_lost(const OSDMap* osdmap) const
 {
   assert(is_primary());
 
   set<int>::const_iterator peer = might_have_unfound.begin();
   set<int>::const_iterator mend = might_have_unfound.end();
   for (; peer != mend; ++peer) {
+    if (peer_missing.count(*peer))
+      continue;
     const osd_info_t &osd_info(osdmap->get_info(*peer));
     if (osd_info.lost_at <= osd_info.up_from) {
       // If there is even one OSD in might_have_unfound that isn't lost, we
@@ -1074,8 +1076,8 @@ bool PG::all_unfound_are_lost(const OSDMap* osdmap) const
       return false;
     }
   }
-  dout(10) << "all_unfound_are_lost all of might_have_unfound " << might_have_unfound 
-          << " are marked lost!" << dendl;
+  dout(10) << "all_unfound_are_queried_or_lost all of might_have_unfound " << might_have_unfound 
+          << " have been queried or are marked lost" << dendl;
   return true;
 }
 
@@ -4100,7 +4102,7 @@ PG::RecoveryState::Active::react(const ActMap&) {
 
   int unfound = pg->missing.num_missing() - pg->missing_loc.size();
   if (unfound > 0 &&
-      pg->all_unfound_are_lost(pg->osd->osdmap)) {
+      pg->all_unfound_are_queried_or_lost(pg->osd->osdmap)) {
     if (g_conf->osd_auto_mark_unfound_lost) {
       pg->osd->clog.error() << pg->info.pgid << " has " << unfound
                            << " objects unfound and apparently lost, would automatically marking lost but NOT IMPLEMENTED\n";
index 7139fc0f2d337fa8b528266f42dc8dc15e0aa964..0a562630c245995e95360e88a233310a6d9629ca 100644 (file)
@@ -1401,7 +1401,7 @@ public:
 
   bool adjust_need_up_thru(const OSDMap *osdmap);
 
-  bool all_unfound_are_lost(const OSDMap* osdmap) const;
+  bool all_unfound_are_queried_or_lost(const OSDMap* osdmap) const;
   virtual void mark_all_unfound_lost() = 0;
 
   bool calc_min_last_complete_ondisk() {