]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: OSDMonitor: HEALTH_WARN on 'mon osd down out interval == 0' 1743/head
authorJoao Eduardo Luis <joao.luis@inktank.com>
Wed, 30 Apr 2014 16:13:30 +0000 (17:13 +0100)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Wed, 30 Apr 2014 16:13:30 +0000 (17:13 +0100)
A 'status' or 'health' request will return a HEALTH_WARN whenever the
monitor handling the request has the option set to zero.

Fixes: 7784
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
(cherry picked from commit b2112d5087b449d3b019678cb266ff6fa897897e)

PendingReleaseNotes
src/common/config_opts.h
src/mon/OSDMonitor.cc

index 6f462c81f5070936d51afba35ae87c6d73da6b45..27bca5ba594924d82435b8c74cf4969292e9ccc6 100644 (file)
@@ -6,3 +6,8 @@ v0.67.8
   non-plain format. This is consistent with the behavior for a pool
   which used to hold images, but contains none. Scripts relying on
   this behavior should be updated.
+
+- HEALTH_WARN on 'mon osd down out interval == 0'. Having this option set
+  to zero on the leader acts much like having the 'noout' flag set.  This
+  warning will only be reported if the monitor getting the 'health' or
+  'status' request has this option set to zero.
index b41db5a178388c787620cdfca12ae0d4f3827e6e..b4f3d9f7216222656533a6948dd6efa5263334da 100644 (file)
@@ -163,6 +163,7 @@ OPTION(mon_osd_nearfull_ratio, OPT_FLOAT, .85) // what % full makes an OSD near
 OPTION(mon_globalid_prealloc, OPT_INT, 100)   // how many globalids to prealloc
 OPTION(mon_osd_report_timeout, OPT_INT, 900)    // grace period before declaring unresponsive OSDs dead
 OPTION(mon_force_standby_active, OPT_BOOL, true) // should mons force standby-replay mds to be active
+OPTION(mon_warn_on_osd_down_out_interval_zero, OPT_BOOL, true) // warn if 'mon_osd_down_out_interval == 0'
 OPTION(mon_min_osdmap_epochs, OPT_INT, 500)
 OPTION(mon_max_pgmap_epochs, OPT_INT, 500)
 OPTION(mon_max_log_epochs, OPT_INT, 500)
index 97a193ca623ac49301ecb4e87cf713465c478727..2431fa84d127243eba60f8a140fcd6af6c68c25f 100644 (file)
@@ -1975,6 +1975,29 @@ void OSDMonitor::get_health(list<pair<health_status_t,string> >& summary,
        detail->push_back(make_pair(HEALTH_WARN, ss.str()));
     }
 
+    // Warn if 'mon_osd_down_out_interval' is set to zero.
+    // Having this option set to zero on the leader acts much like the
+    // 'noout' flag.  It's hard to figure out what's going wrong with clusters
+    // without the 'noout' flag set but acting like that just the same, so
+    // we report a HEALTH_WARN in case this option is set to zero.
+    // This is an ugly hack to get the warning out, but until we find a way
+    // to spread global options throughout the mon cluster and have all mons
+    // using a base set of the same options, we need to work around this sort
+    // of things.
+    // There's also the obvious drawback that if this is set on a single
+    // monitor on a 3-monitor cluster, this warning will only be shown every
+    // third monitor connection.
+    if (g_conf->mon_warn_on_osd_down_out_interval_zero &&
+        g_conf->mon_osd_down_out_interval == 0) {
+      ostringstream ss;
+      ss << "mon." << mon->name << " has mon_osd_down_out_interval set to 0";
+      summary.push_back(make_pair(HEALTH_WARN, ss.str()));
+      if (detail) {
+        ss << "; this has the same effect as the 'noout' flag";
+        detail->push_back(make_pair(HEALTH_WARN, ss.str()));
+      }
+    }
+
     get_pools_health(summary, detail);
   }
 }