]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: exclude destroyed OSDs from "ceph node ls" output 62326/head
authorNitzan Mordechai <nmordech@redhat.com>
Tue, 11 Mar 2025 15:37:07 +0000 (15:37 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Sun, 16 Mar 2025 09:42:33 +0000 (09:42 +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>
(cherry picked from commit 97c43c728dc8e702ce19bc14f6aa9a4790c8415b)

src/mon/OSDMonitor.cc

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