From: Sage Weil Date: Mon, 15 Jul 2019 19:47:11 +0000 (-0500) Subject: osd/OSDMap: add is_dead() helper X-Git-Tag: v15.1.0~2076^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b75e17159b970e97280ecf809333e1daafc4c091;p=ceph-ci.git osd/OSDMap: add is_dead() helper Signed-off-by: Sage Weil --- diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index 08697b21c13..10a3413150a 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -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;