From: Mykola Golub Date: Tue, 3 Mar 2015 06:45:58 +0000 (+0200) Subject: osd: fix PG::all_unfound_are_queried_or_lost for non-existent osds X-Git-Tag: v0.80.10~14^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1f6b1bb51d0b40899155313165ac5e3a21dde11a;p=ceph.git osd: fix PG::all_unfound_are_queried_or_lost for non-existent osds 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 (cherry picked from commit 5bb51320138ff714806d24312149f6275d546608) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index ad5cd89fcee..0056245932d 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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