From 1f6b1bb51d0b40899155313165ac5e3a21dde11a Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Tue, 3 Mar 2015 08:45:58 +0200 Subject: [PATCH] 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) --- src/osd/PG.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index ad5cd89fcee3..0056245932d5 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 -- 2.47.3