]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MgrMonitor.cc: warn about missing mgr in a cluster with osds 33142/head
authorNeha <nojha@redhat.com>
Fri, 31 Jan 2020 19:10:04 +0000 (19:10 +0000)
committerShyukri Shyukriev <shshyukriev@suse.com>
Sat, 8 Feb 2020 20:59:18 +0000 (22:59 +0200)
A lot of our functionality depends on the mgr now. If there is a cluster
set up with osds but no mgr, issue a warning.

Fixes: https://tracker.ceph.com/issues/38942
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit c20e51c3c5b06e7912e2c6875dadbd2a85b34eb0)

src/mon/MgrMonitor.cc

index 80e4121c43276cfb32c643cfd8fd00b86ef134a1..8d428fa7a6d6e0b8cc02b59f79ad36dbf8bb980b 100644 (file)
@@ -236,14 +236,11 @@ void MgrMonitor::create_pending()
 health_status_t MgrMonitor::should_warn_about_mgr_down()
 {
   utime_t now = ceph_clock_now();
-  // we warn if
-  //   - we've ever had an active mgr, or
-  //   - we have osds AND we've exceeded the grace period
+  // we warn if we have osds AND we've exceeded the grace period
   // which means a new mon cluster and be HEALTH_OK indefinitely as long as
   // no OSDs are ever created.
-  if (ever_had_active_mgr ||
-      (mon->osdmon()->osdmap.get_num_osds() > 0 &&
-       now > mon->monmap->created + g_conf().get_val<int64_t>("mon_mgr_mkfs_grace"))) {
+  if (mon->osdmon()->osdmap.get_num_osds() > 0 &&
+       now > mon->monmap->created + g_conf().get_val<int64_t>("mon_mgr_mkfs_grace")) {
     health_status_t level = HEALTH_WARN;
     if (first_seen_inactive != utime_t() &&
        now - first_seen_inactive > g_conf().get_val<int64_t>("mon_mgr_inactive_grace")) {