]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: make mon_osd_down_out_subtree_limit update at runtime 27582/head
authorSage Weil <sage@redhat.com>
Thu, 11 Apr 2019 13:41:03 +0000 (08:41 -0500)
committerSage Weil <sage@redhat.com>
Sun, 14 Apr 2019 20:30:35 +0000 (15:30 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 93b8f0404a2bdc53da75dab334db2826850d90ae)

src/common/legacy_config_opts.h
src/common/options.cc
src/mon/OSDMonitor.cc

index 7fca65131af15744aab4e35176551abd46600142..58e5e075e9bef8159ca8c728ad4e7528a14915c1 100644 (file)
@@ -215,7 +215,6 @@ OPTION(mon_osd_auto_mark_auto_out_in, OPT_BOOL) // mark booting auto-marked-out
 OPTION(mon_osd_auto_mark_new_in, OPT_BOOL)      // mark booting new osds 'in'
 OPTION(mon_osd_destroyed_out_interval, OPT_INT) // seconds
 OPTION(mon_osd_down_out_interval, OPT_INT) // seconds
-OPTION(mon_osd_down_out_subtree_limit, OPT_STR)   // smallest crush unit/type that we will not automatically mark out
 OPTION(mon_osd_min_up_ratio, OPT_DOUBLE)    // min osds required to be up to mark things down
 OPTION(mon_osd_min_in_ratio, OPT_DOUBLE)   // min osds required to be in to mark things out
 OPTION(mon_osd_warn_op_age, OPT_DOUBLE)     // max op age before we generate a warning (make it a power of 2)
index 22a767f2afc79263fad1fdbcd5dea45a96e9948c..7b33c6b2c1d8df617ee2d4601df14ce30da35ee2 100644 (file)
@@ -1399,6 +1399,7 @@ std::vector<Option> get_global_options() {
 
     Option("mon_osd_down_out_subtree_limit", Option::TYPE_STR, Option::LEVEL_ADVANCED)
     .set_default("rack")
+    .set_flag(Option::FLAG_RUNTIME)
     .add_service("mon")
     .set_description("do not automatically mark OSDs 'out' if an entire subtree of this size is down")
     .add_see_also("mon_osd_down_out_interval"),
index 5e995d4bc857e013aa9c2155bae8f8b1f2e6f9e1..0256eed09f0f1a6c335c38befa1a42e4ccd8ceee 100644 (file)
@@ -4346,6 +4346,8 @@ void OSDMonitor::tick()
    * ratio set by g_conf()->mon_osd_min_in_ratio. So it's not really up to us.
    */
   if (can_mark_out(-1)) {
+    string down_out_subtree_limit = g_conf().get_val<string>(
+      "mon_osd_down_out_subtree_limit");
     set<int> down_cache;  // quick cache of down subtrees
 
     map<int,utime_t>::iterator i = down_pending_out.begin();
@@ -4375,12 +4377,13 @@ void OSDMonitor::tick()
        }
 
        // is this an entire large subtree down?
-       if (g_conf()->mon_osd_down_out_subtree_limit.length()) {
-         int type = osdmap.crush->get_type_id(g_conf()->mon_osd_down_out_subtree_limit);
+       if (down_out_subtree_limit.length()) {
+         int type = osdmap.crush->get_type_id(down_out_subtree_limit);
          if (type > 0) {
            if (osdmap.containing_subtree_is_down(cct, o, type, &down_cache)) {
-             dout(10) << "tick entire containing " << g_conf()->mon_osd_down_out_subtree_limit
-                      << " subtree for osd." << o << " is down; resetting timer" << dendl;
+             dout(10) << "tick entire containing " << down_out_subtree_limit
+                      << " subtree for osd." << o
+                      << " is down; resetting timer" << dendl;
              // reset timer, too.
              down_pending_out[o] = now;
              continue;