]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix PG::all_unfound_are_queried_or_lost for non-existent osds
authorMykola Golub <mgolub@mirantis.com>
Tue, 3 Mar 2015 06:45:58 +0000 (08:45 +0200)
committerMykola Golub <mgolub@mirantis.com>
Wed, 25 Mar 2015 07:31:52 +0000 (09:31 +0200)
A common mistake upon osd loss is to remove the osd from the crush map
before marking the osd lost. This tends to make it so that the user
can no longer mark the osd lost to satisfy all_unfound_are_queried_or_lost.

The simple solution is for all_unfound_are_queried_or_lost to ignore
the osd if it does not exist.

Fixes: #10976
Backports: firefly,giant

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/osd/PG.cc

index 8c76429c4d98e0730bc09385755ea00b24d71253..6b785eaaf2061b7acd861ba0c806dca33be37abf 100644 (file)
@@ -792,6 +792,8 @@ bool PG::all_unfound_are_queried_or_lost(const OSDMapRef osdmap) const
     if (iter != peer_info.end() &&
         (iter->second.is_empty() || iter->second.dne()))
       continue;
+    if (!osdmap->exists(peer->osd))
+      continue;
     const osd_info_t &osd_info(osdmap->get_info(peer->osd));
     if (osd_info.lost_at <= osd_info.up_from) {
       // If there is even one OSD in might_have_unfound that isn't lost, we