]> 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>
Wed, 22 Apr 2026 14:22:18 +0000 (14:22 +0000)
Expanded interface by collect_alerts.
Created category "EBD_PROBLEMS" for ExtBlkDev problems.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/blk/kernel/KernelDevice.cc
src/extblkdev/ExtBlkDevInterface.h
src/mon/PGMap.cc

index e7193c19ea6e04556d06cd350e01c928ed952698..01f17f0f7e8318ee9e7d739e7149eb2d54dc7a75 100644 (file)
@@ -925,6 +925,9 @@ bool KernelDevice::try_discard(interval_set<uint64_t> &to_release,
 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 b9e553c8c1f1cafc2723c8e30f7faaa4dfbfb5ec..a1e31154a89d0c3f140d55c40b41ace5712b8f4e 100644 (file)
@@ -35,6 +35,7 @@
 #include <map>
 #include <ostream>
 #include <memory>
+#include "osd/osd_types.h"
 #ifdef __linux__
 #include <sys/capability.h>
 #else
@@ -112,6 +113,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 c5bbf8e95e08a0c77bdcb2477a4692eb3aa40819..e57cb4a534aaf6b52f7832dbed76ed48a8d5c6d1 100644 (file)
@@ -3332,6 +3332,8 @@ void PGMap::get_health_checks(
         summary += " experiencing slow discard operations";
       } else if (asum.first == "BLUESTORE_FREE_FRAGMENTATION") {
         summary += " experiencing high free space fragmentation of BlueStore";
+      } else if (asum.first == "EXTBLKDEV") {
+        summary += " reporting problems with ExtBlkDev plugin";
       }
 
       auto& d = checks->add(asum.first, HEALTH_WARN, summary, asum.second.first);