]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: If the requested OSD is down don't trust osd_stat info
authorDavid Zafman <dzafman@redhat.com>
Thu, 18 Apr 2019 02:41:58 +0000 (19:41 -0700)
committerDavid Zafman <dzafman@redhat.com>
Thu, 25 Apr 2019 20:53:27 +0000 (13:53 -0700)
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>
src/mgr/DaemonServer.cc

index 0dd24c270e6cce551919da18101f74280d14d5b3..773fccc2ac37f470194618e8af633d716f680443 100644 (file)
@@ -1389,7 +1389,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) {