From 324345419d73f3683bf79a4c0d04ad19fec42ed0 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Wed, 17 Apr 2019 19:41:58 -0700 Subject: [PATCH] mgr: If the requested OSD is down don't trust osd_stat info If we have a down AND out OSD it may contains osd_stat with num_pgs == 0. When all PGs aren't active+clean we need an accurate value or we consider the osd missing stat info. Fixes: https://tracker.ceph.com/issues/38930 Signed-off-by: David Zafman (cherry picked from commit 97f3b7c2e93f72223ae2c9a904e38bbb30e275da) --- src/mgr/DaemonServer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index 4b9ee4b301ff5..9d5ac54db62d3 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -1393,7 +1393,7 @@ bool DaemonServer::_handle_command( if (num_active_clean < pg_map.num_pg) { // all pgs aren't active+clean; we need to be careful. auto p = pg_map.osd_stat.find(osd); - if (p == pg_map.osd_stat.end()) { + if (p == pg_map.osd_stat.end() || !osdmap.is_up(osd)) { missing_stats.insert(osd); continue; } else if (p->second.num_pgs > 0) { -- 2.39.5