]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Log "ceph health detail" periodically in cluster log 37902/head
authorPrashant D <pdhange@redhat.com>
Fri, 30 Oct 2020 10:40:43 +0000 (06:40 -0400)
committerPrashant D <pdhange@redhat.com>
Thu, 12 Nov 2020 00:08:51 +0000 (19:08 -0500)
change mon_health_to_clog_interval from 1_hr -> 10_min to
log health summary or detail more frequently.

Fixes: https://tracker.ceph.com/issues/48042
Signed-off-by: Prashant Dhange <pdhange@redhat.com>
PendingReleaseNotes
qa/tasks/ceph.conf.template
src/common/legacy_config_opts.h
src/common/options.cc
src/mon/Monitor.cc

index 13e3e818927c75c38ede705d43def1c053071774..864b492bcf69797c31b0339876dd38537011bb22 100644 (file)
 >=15.0.0
 --------
 
+* MON: The cluster log now logs health detail every ``mon_health_to_clog_interval``,
+  which has been changed from 1hr to 10min. Logging of health detail will be
+  skipped if there is no change in health summary since last known.
+
 * The ``ceph df`` command now lists the number of pgs in each pool.
 
 * Monitors now have config option ``mon_allow_pool_size_one``, which is disabled
index 6eff6e339a0c7494ddaf9d808756363cf4770e83..2679c2345401b416fd34a4a25299af7c226ca878 100644 (file)
@@ -40,6 +40,7 @@
 
        mon cluster log file level = debug
        debug asserts on shutdown = true
+       mon health detail to clog = false
 
 [osd]
         osd journal size = 100
index 28c2a4593d0bb6df61727885998b08503844a982..2058532d2999d50e7218143f25df7ccb9c7b4ab5 100644 (file)
@@ -263,6 +263,7 @@ 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_detail_to_clog, 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 28ad9c79227898b9735f57aa15f3015852074827..3f52a9a01c18292c7ea45f68c8fe5d55449eba7e 100644 (file)
@@ -1941,7 +1941,7 @@ std::vector<Option> get_global_options() {
     .set_description("log monitor health to cluster log"),
 
     Option("mon_health_to_clog_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
-    .set_default(1_hr)
+    .set_default(10_min)
     .add_service("mon")
     .set_description("frequency to log monitor health to cluster log")
     .add_see_also("mon_health_to_clog"),
@@ -1951,6 +1951,10 @@ std::vector<Option> get_global_options() {
     .add_service("mon")
     .set_description(""),
 
+    Option("mon_health_detail_to_clog", Option::TYPE_BOOL, Option::LEVEL_DEV)
+    .set_default(true)
+    .set_description("log health detail to cluster log"),
+
     Option("mon_health_max_detail", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(50)
     .add_service("mon")
index 6ba0cbf0545fb4189d5f0a0a7e81e3c25018b3c0..04ce5e3961e1fa5d2c2690f6c8598924ca956a60 100644 (file)
@@ -2835,7 +2835,16 @@ void Monitor::do_health_to_clog(bool force)
       summary == health_status_cache.summary &&
       level == health_status_cache.overall)
     return;
-  clog->health(level) << "overall " << summary;
+
+  if (g_conf()->mon_health_detail_to_clog &&
+      summary != health_status_cache.summary &&
+      level != HEALTH_OK) {
+    string details;
+    level = healthmon()->get_health_status(true, nullptr, &details);
+    clog->health(level) << "Health detail: " << details;
+  } else {
+    clog->health(level) << "overall " << summary;
+  }
   health_status_cache.summary = summary;
   health_status_cache.overall = level;
 }