Skip to content

Commit

Permalink
mgr: If the requested OSD is down don't trust osd_stat info
Browse files Browse the repository at this point in the history
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 <dzafman@redhat.com>
(cherry picked from commit 97f3b7c)
  • Loading branch information
dzafman authored and Smith Farm committed Apr 30, 2019
1 parent 3945264 commit 3243454
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mgr/DaemonServer.cc
Expand Up @@ -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) {
Expand Down

0 comments on commit 3243454

Please sign in to comment.