]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: allow a MON_DOWN grace period after cluster mkfs 42366/head
authorSage Weil <sage@newdream.net>
Thu, 15 Jul 2021 20:17:23 +0000 (15:17 -0500)
committerSage Weil <sage@newdream.net>
Thu, 15 Jul 2021 20:17:23 +0000 (15:17 -0500)
During teuthology tests, the initial cluster bootstrap often starts up
the mon sbut doesn't include all mons in the initial quorum, due to
mon startup misalignment and random delays.  Provide a short grace period
where we will not raise a MON_DOWN alert even though the quorum is not
complete.

Fixes: https://tracker.ceph.com/issues/43584
Signed-off-by: Sage Weil <sage@newdream.net>
src/common/options/mon.yaml.in
src/mon/HealthMonitor.cc

index 535dc65e26a2e0a807f3c81e43b45524f85ec78f..1ec9309397ba5325df6e36e4dbe06abe45d0544e 100644 (file)
@@ -39,6 +39,13 @@ options:
   default: 5
   services:
   - mon
+- name: mon_down_mkfs_grace
+  type: secs
+  level: advanced
+  desc: Period in seconds that the cluster may have a mon down after cluster creation
+  default: 1_min
+  services:
+  - mon
 - name: mon_mgr_beacon_grace
   type: secs
   level: advanced
index bf8cf394bd9a6791fedf192d0e9b35df2aa63676..3adbdc3de59f907ed3e15a3975a9e4af3ae8a542 100644 (file)
@@ -797,7 +797,9 @@ void HealthMonitor::check_for_mon_down(health_check_map_t *checks)
 {
   int max = mon.monmap->size();
   int actual = mon.get_quorum().size();
-  if (actual < max) {
+  const auto now = ceph::real_clock::now();
+  if (actual < max &&
+      now > mon.monmap->created.to_real_time() + g_conf().get_val<std::chrono::seconds>("mon_down_mkfs_grace")) {
     ostringstream ss;
     ss << (max-actual) << "/" << max << " mons down, quorum "
        << mon.get_quorum_names();