]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: exclude destroyed OSDs from "ceph node ls" output 62243/head
authorNitzan Mordechai <nmordech@redhat.com>
Tue, 11 Mar 2025 15:37:07 +0000 (15:37 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Wed, 12 Mar 2025 07:09:21 +0000 (07:09 +0000)
After destroying an OSD, the command "ceph node ls" still listed the destroyed OSD,
causing confusion. This fix ensures that the status of the OSD is checked before
adding it to the output, aligning its behavior with "ceph osd tree," which already
displays the correct status.

Fixes: https://tracker.ceph.com/issues/70400
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
src/mon/OSDMonitor.cc

index 3cff87879f7cb5bbdbec7155374471f2db920372..47c2b39af85f69c2c712275b620434c7ea3a221d 100644 (file)
@@ -2198,6 +2198,9 @@ void OSDMonitor::print_nodes(Formatter *f)
       // not likely though
       continue;
     }
+    if (osdmap.is_destroyed(osd)) {
+      continue;
+    }
     osds[hostname->second].push_back(osd);
   }