]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove pre-luminous health output compatibility 23694/head
authorJohn Spray <john.spray@redhat.com>
Wed, 22 Aug 2018 14:49:20 +0000 (10:49 -0400)
committerJohn Spray <john.spray@redhat.com>
Mon, 10 Sep 2018 15:39:58 +0000 (16:39 +0100)
As of nautilus, this will be more than two versions old:
external tooling should have been updated by now.

Signed-off-by: John Spray <john.spray@redhat.com>
PendingReleaseNotes
src/common/legacy_config_opts.h
src/common/options.cc
src/mon/Monitor.cc
src/mon/health_check.h

index bf44d58872200942412786c4a435421d0e814ca2..19022ba0ab1b5fdd042f86cee02a41dbd4f5ca82 100644 (file)
@@ -4,6 +4,10 @@
 * The 'ceph osd rm' command has been deprecated.  Users should use
   'ceph osd destroy' or 'ceph osd purge' (but after first confirming it is
   safe to do so via the 'ceph osd safe-to-destroy' command).
+* The mon_health_preluminous_compat and mon_health_preluminous_compat_warning
+  config options are removed, as the related functionality is more
+  than two versions old.  Any legacy monitoring system expecting Jewel-style
+  health output will need to be updated to work with Nautilus.
 
 * Nautilus is not supported on any distros still running upstart so upstart
   specific files and references have been removed.
index 4da595dc3e946a76f739dd925d4a090c4bddfb22..b817741cf1de8a73d07493777205e1bd5410cb10 100644 (file)
@@ -270,7 +270,6 @@ OPTION(mon_reweight_max_change, OPT_DOUBLE)
 OPTION(mon_health_to_clog, OPT_BOOL)
 OPTION(mon_health_to_clog_interval, OPT_INT)
 OPTION(mon_health_to_clog_tick_interval, OPT_DOUBLE)
-OPTION(mon_health_preluminous_compat, OPT_BOOL)
 OPTION(mon_data_avail_crit, OPT_INT)
 OPTION(mon_data_avail_warn, OPT_INT)
 OPTION(mon_data_size_warn, OPT_U64) // issue a warning when the monitor's data store goes over 15GB (in bytes)
index 7973c63719ea533be21962fcc8dc701b1993800d..5210daf89ebed36a17805d8126b46f37a4b2bc3e 100644 (file)
@@ -1599,14 +1599,6 @@ std::vector<Option> get_global_options() {
     .set_default(60.0)
     .set_description(""),
 
-    Option("mon_health_preluminous_compat", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
-    .set_default(false)
-    .set_description("Include health warnings in preluminous JSON fields"),
-
-    Option("mon_health_preluminous_compat_warning", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
-    .set_default(true)
-    .set_description("Warn about the health JSON format change in preluminous JSON fields"),
-
     Option("mon_health_max_detail", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(50)
     .set_description("max detailed pgs to report in health detail"),
index 98c80ed4b317078c6b58b2302cf3971b03d990f6..d1283834a17b8f32ed37e8114386530c798d2289 100644 (file)
@@ -2562,8 +2562,6 @@ health_status_t Monitor::get_health_status(
   const char *sep2)
 {
   health_status_t r = HEALTH_OK;
-  bool compat = g_conf()->mon_health_preluminous_compat;
-  bool compat_warn = g_conf().get_val<bool>("mon_health_preluminous_compat_warning");
   if (f) {
     f->open_object_section("health");
     f->open_object_section("checks");
@@ -2579,6 +2577,7 @@ health_status_t Monitor::get_health_status(
   if (f) {
     f->close_section();
     f->dump_stream("status") << r;
+    f->close_section();
   } else {
     // one-liner: HEALTH_FOO[ thing1[; thing2 ...]]
     *plain = stringify(r);
@@ -2589,43 +2588,12 @@ health_status_t Monitor::get_health_status(
     *plain += "\n";
   }
 
-  if (f && (compat || compat_warn)) {
-    health_status_t cr = compat_warn ? min(HEALTH_WARN, r) : r;
-    if (compat) {
-      f->open_array_section("summary");
-      if (compat_warn) {
-       f->open_object_section("item");
-       f->dump_stream("severity") << HEALTH_WARN;
-       f->dump_string("summary", "'ceph health' JSON format has changed in luminous; update your health monitoring scripts");
-       f->close_section();
-      }
-      for (auto& svc : paxos_service) {
-       svc->get_health_checks().dump_summary_compat(f);
-      }
-      f->close_section();
-    }
-    f->dump_stream("overall_status") << cr;
-  }
-
-  if (want_detail) {
-    if (f && (compat || compat_warn)) {
-      f->open_array_section("detail");
-      if (compat_warn) {
-       f->dump_string("item", "'ceph health' JSON format has changed in luminous. If you see this your monitoring system is scraping the wrong fields. Disable this with 'mon health preluminous compat warning = false'");
-      }
-    }
-
+  if (want_detail && !f) {
     for (auto& svc : paxos_service) {
-      svc->get_health_checks().dump_detail(f, plain, compat);
-    }
-
-    if (f && (compat || compat_warn)) {
-      f->close_section();
+      svc->get_health_checks().dump_detail(plain);
     }
   }
-  if (f) {
-    f->close_section();
-  }
+
   return r;
 }
 
index 935432e36cea79cc15012d88d7ec8c54413806a8..94adbcb3ef954b1d8dd8c6a39cb9c1cdb9f5feb5 100644 (file)
@@ -178,27 +178,13 @@ struct health_check_map_t {
     }
   }
 
-  void dump_detail(Formatter *f, std::string *plain, bool compat) const {
+  void dump_detail(std::string *plain) const {
     for (auto& p : checks) {
-      if (f) {
-       if (compat) {
-         // this is sloppy, but the best we can do: just dump all of the
-         // individual checks' details together
-         for (auto& d : p.second.detail) {
-           f->dump_string("item", d);
-         }
-       }
-      } else {
-       if (!compat) {
-         *plain += p.first + " " + p.second.summary + "\n";
-       }
-       for (auto& d : p.second.detail) {
-         if (!compat) {
-           *plain += "    ";
-         }
-         *plain += d;
-         *plain += "\n";
-       }
+      *plain += p.first + " " + p.second.summary + "\n";
+      for (auto& d : p.second.detail) {
+        *plain += "    ";
+        *plain += d;
+        *plain += "\n";
       }
     }
   }