]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add method to check for laggy osds
authordparmar18 <dparmar@redhat.com>
Thu, 16 Feb 2023 09:48:42 +0000 (15:18 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Fri, 20 Oct 2023 10:20:09 +0000 (15:50 +0530)
Fixes: https://tracker.ceph.com/issues/58023
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit 95fbe303a9692ac8dd2694298e32af951adfbe06)

src/osd/OSDMap.cc
src/osd/OSDMap.h

index 650f633cfd3fd97bf510b68baaebf22e9f628ea7..b9f1906b4916bac7bea6f2d55e1dc6f559a6fb08 100644 (file)
@@ -1871,6 +1871,18 @@ uint64_t OSDMap::get_up_osd_features() const
   return cached_up_osd_features;
 }
 
+bool OSDMap::any_osd_laggy() const
+{
+  for (int osd = 0; osd < max_osd; ++osd) {
+    if (!is_up(osd)) { continue; }
+    const auto &xi = get_xinfo(osd);
+    if (xi.laggy_probability || xi.laggy_interval) {
+      return true;
+    }
+  }
+  return false;
+}
+
 void OSDMap::dedup(const OSDMap *o, OSDMap *n)
 {
   using ceph::encode;
index 3ca12901ac63286d9c217a8e9550ca3a77b5ad9c..920bb8fdf50f2c40e5e054a9dc68df983c554ef9 100644 (file)
@@ -654,6 +654,7 @@ private:
  public:
   bool have_crc() const { return crc_defined; }
   uint32_t get_crc() const { return crc; }
+  bool any_osd_laggy() const;
 
   std::shared_ptr<CrushWrapper> crush;       // hierarchical map
   bool stretch_mode_enabled; // we are in stretch mode, requiring multiple sites