]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix PG::all_unfound_are_queried_or_lost for non-existent osds 4416/head
authorMykola Golub <mgolub@mirantis.com>
Tue, 3 Mar 2015 06:45:58 +0000 (08:45 +0200)
committerxinxin shu <xinxin.shu@intel.com>
Thu, 23 Apr 2015 21:54:50 +0000 (05:54 +0800)
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>
(cherry picked from commit 5bb51320138ff714806d24312149f6275d546608)

src/osd/PG.cc

index ad5cd89fcee322f6d576dc7062ce51479703e078..0056245932d571e5426e9181019c3d310bd5e49c 100644 (file)
@@ -763,6 +763,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