]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/OSDMap: add is_dead() helper
authorSage Weil <sage@redhat.com>
Mon, 15 Jul 2019 19:47:11 +0000 (14:47 -0500)
committerSage Weil <sage@redhat.com>
Thu, 25 Jul 2019 20:55:35 +0000 (15:55 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSDMap.h

index 08697b21c1371ff9b1aeb18d69448ff4ac6dc3ef..10a3413150a1f7b02df89a5619bdf35000e15b9c 100644 (file)
@@ -846,6 +846,13 @@ public:
     return !is_out(osd);
   }
 
+  bool is_dead(int osd) const {
+    if (!exists(osd)) {
+      return false; // unclear if they know they are removed from map
+    }
+    return get_xinfo(osd).dead_epoch > get_info(osd).up_from;
+  }
+
   unsigned get_osd_crush_node_flags(int osd) const;
   unsigned get_crush_node_flags(int id) const;
   unsigned get_device_class_flags(int id) const;