]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
blk/extblkdev: Health warns from ExtBlkDev plugins
authorAdam Kupczyk <akupczyk@ibm.com>
Wed, 15 Apr 2026 10:59:46 +0000 (10:59 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Mon, 4 May 2026 16:27:10 +0000 (16:27 +0000)
Expanded interface by collect_alerts.
Created category "EBD_PROBLEMS" for ExtBlkDev problems.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit f4beeb2038691e289c853a973ee9dfdff18ace4d)

src/blk/kernel/KernelDevice.cc
src/extblkdev/ExtBlkDevInterface.h
src/mon/PGMap.cc

index a9b63b165b6fee2419b03a4b7365cf9bebefe861..ca3228bb56a88e8aab657abf422eea93660292b3 100644 (file)
@@ -897,6 +897,9 @@ bool KernelDevice::try_discard(interval_set<uint64_t> &to_release, bool async)
 void KernelDevice::collect_alerts(osd_alert_list_t& alerts, const std::string& device_name)
 {
   BlockDevice::collect_alerts(alerts, device_name);
+  if (ebd_impl) {
+    ebd_impl->collect_alerts(alerts);
+  }
 }
 
 void KernelDevice::_aio_log_start(
index 66121190ce654f6eba140b8532a42747609a3906..e804be14a6aa4c5be64edb6c9ccf9f5afd2177e8 100644 (file)
@@ -34,6 +34,7 @@
 #include <map>
 #include <ostream>
 #include <memory>
+#include "osd/osd_types.h"
 #ifdef __linux__
 #include <sys/capability.h>
 #else
@@ -111,6 +112,14 @@ namespace ceph {
      * @return 0 on success or a negative errno on error.
      */
     virtual int get_plugin_id(std::string& id_str) = 0;
+
+    /**
+     * Retrieve alerts from the plugin, if any.
+     * This function is used to give plugin a way to signal health warnings.
+     *
+     * @param [out] alerts append warnings here.
+     */
+    virtual void collect_alerts(osd_alert_list_t& alerts) {}
   };
 
   typedef std::shared_ptr<ExtBlkDevInterface> ExtBlkDevInterfaceRef;
index 07304cfcd8e64f297ca454ddd56d142bfc7ebe15..ed302cb03384048a6ffb54cf7d7861268e3824b6 100644 (file)
@@ -3313,6 +3313,8 @@ void PGMap::get_health_checks(
         summary += " experiencing stalled read in wal device of BlueFS";
       } else if (asum.first == "DB_DEVICE_STALLED_READ_ALERT") {
         summary += " experiencing stalled read in db device of BlueFS";
+      } else if (asum.first == "EXTBLKDEV") {
+        summary += " reporting problems with ExtBlkDev plugin";
       }
 
       auto& d = checks->add(asum.first, HEALTH_WARN, summary, asum.second.first);