]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: introduce legacy statfs alert
authorIgor Fedotov <ifedotov@suse.com>
Wed, 10 Apr 2019 16:18:37 +0000 (19:18 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Wed, 17 Apr 2019 11:13:14 +0000 (14:13 +0300)
Fixes: https://tracker.ceph.com/issues/39146
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit 92688f5fe165b5fc12b798a4cc5321a6148ca3ff)

src/common/legacy_config_opts.h
src/common/options.cc
src/mon/PGMap.cc
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 20400f46903d5e084dc532ebff5a79130e8c4184..6a302783b4487cc87578c2ac9183df5a809d0125 100644 (file)
@@ -1071,6 +1071,7 @@ OPTION(bluestore_debug_inject_bug21040, OPT_BOOL)
 OPTION(bluestore_debug_inject_csum_err_probability, OPT_FLOAT)
 OPTION(bluestore_no_per_pool_stats_tolerance, OPT_STR)
 OPTION(bluestore_warn_on_bluefs_spillover, OPT_BOOL)
+OPTION(bluestore_warn_on_legacy_statfs, OPT_BOOL)
 OPTION(bluestore_log_op_age, OPT_DOUBLE)
 OPTION(bluestore_log_omap_iterator_age, OPT_DOUBLE)
 
index 8d5890ff7b8f2e17ced9a36ca5f420c2c5f76fea..28812caf72660dcc65437da8f428fb8122913d7a 100644 (file)
@@ -4745,6 +4745,10 @@ std::vector<Option> get_global_options() {
     .set_default(true)
     .set_description("Enable health indication on bluefs slow device usage"),
 
+    Option("bluestore_warn_on_legacy_statfs", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_default(true)
+    .set_description("Enable health indication on lack of per-pool statfs reporting from bluestore"),
+
     Option("bluestore_log_op_age", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
     .set_default(5)
     .set_description("log operation if it's slower than this age (seconds)"),
index 78731fd707911339e9043d95620f5bba820b03c3..e6e4829edf9e1332bc2a4049c0bc463e3d6e3d43 100644 (file)
@@ -2994,6 +2994,8 @@ void PGMap::get_health_checks(
        summary = "BlueFS spillover detected";
       } else if (asum.first == "BLUESTORE_NO_COMPRESSION") {
        summary = "BlueStore compression broken";
+      } else if (asum.first == "BLUESTORE_LEGACY_STATFS") {
+       summary = "Legacy BlueStore stats reporting detected";
       }
       summary += " on ";
       summary += stringify(asum.second.first);
index 552625a437841e8c732b26f4c6e84c6a35fba091..bef723f038744eca1177ff7316c4f51e462d7266 100644 (file)
@@ -4035,6 +4035,8 @@ const char **BlueStore::get_tracked_conf_keys() const
     "osd_memory_cache_min",
     "bluestore_cache_autotune",
     "bluestore_cache_autotune_interval",
+    "bluestore_no_per_pool_stats_tolerance",
+    "bluestore_warn_on_legacy_statfs",
     NULL
   };
   return KEYS;
@@ -4043,6 +4045,11 @@ const char **BlueStore::get_tracked_conf_keys() const
 void BlueStore::handle_conf_change(const ConfigProxy& conf,
                                   const std::set<std::string> &changed)
 {
+  if (changed.count("bluestore_no_per_pool_stats_tolerance") ||
+      changed.count("bluestore_warn_on_legacy_statfs")) {
+    _check_legacy_statfs_alert();
+  }
+
   if (changed.count("bluestore_csum_type")) {
     _set_csum();
   }
@@ -5797,6 +5804,7 @@ void BlueStore::_open_statfs()
     } else {
       dout(10) << __func__ << " store_statfs is corrupt, using empty" << dendl;
     }
+    _check_legacy_statfs_alert();
   } else if (cct->_conf->bluestore_no_per_pool_stats_tolerance == "enforce") {
     per_pool_stat_collection = false;
     dout(10) << __func__ << " store_statfs is requested but missing, using empty" << dendl;
@@ -8168,6 +8176,7 @@ int BlueStore::statfs(struct store_statfs_t *buf,
 int BlueStore::pool_statfs(uint64_t pool_id, struct store_statfs_t *buf)
 {
   dout(20) << __func__ << " pool " << pool_id<< dendl;
+
   if (!per_pool_stat_collection) {
     dout(20) << __func__ << " not supported in legacy mode " << dendl;
     return -ENOTSUP;
@@ -8182,6 +8191,19 @@ int BlueStore::pool_statfs(uint64_t pool_id, struct store_statfs_t *buf)
   return 0;
 }
 
+void BlueStore::_check_legacy_statfs_alert()
+{
+  string s;
+  if (!per_pool_stat_collection &&
+    cct->_conf->bluestore_no_per_pool_stats_tolerance != "enforce" &&
+    cct->_conf->bluestore_warn_on_legacy_statfs) {
+    s = "legacy statfs reporting detected, "
+        "suggest to run store repair to get consistent statistic reports";
+  }
+  std::lock_guard l(qlock);
+  legacy_statfs_alert = s;
+}
+
 // ---------------
 // cache
 
@@ -13781,6 +13803,11 @@ void BlueStore::_log_alerts(osd_alert_list_t& alerts)
 {
   std::lock_guard l(qlock);
 
+  if (!legacy_statfs_alert.empty()) {
+    alerts.emplace(
+      "BLUESTORE_LEGACY_STATFS",
+      legacy_statfs_alert);
+  }
   if (!spillover_alert.empty() &&
       cct->_conf->bluestore_warn_on_bluefs_spillover) {
     alerts.emplace(
index f93fcabac0f7d5df7dff9ea42a1e9100f3fffb7a..a66765c65b98a4fa43ee60e0658ab1b5c34e188f 100644 (file)
@@ -2697,6 +2697,7 @@ private:
   string failed_cmode;
   set<string> failed_compressors;
   string spillover_alert;
+  string legacy_statfs_alert;
 
   void _log_alerts(osd_alert_list_t& alerts);
   bool _set_compression_alert(bool cmode, const char* s) {
@@ -2723,6 +2724,8 @@ private:
     spillover_alert.clear();
   }
 
+  void _check_legacy_statfs_alert();
+
 private:
 
   // --------------------------------------------------------