]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: introduce mon_osd_destroyed_out_interval for destroyed out control 16446/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 26 Jul 2017 07:18:49 +0000 (15:18 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 26 Jul 2017 07:18:49 +0000 (15:18 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/common/legacy_config_opts.h
src/common/options.cc
src/mon/OSDMonitor.cc

index 750240cfb4111209cecf3048dba30b946b4b1c7e..c0b0192d98a5b8313917dc2993d9922c76cbd327 100644 (file)
@@ -212,6 +212,7 @@ OPTION(mon_osd_adjust_down_out_interval, OPT_BOOL)  // true if we should scale b
 OPTION(mon_osd_auto_mark_in, OPT_BOOL)         // mark any booting osds 'in'
 OPTION(mon_osd_auto_mark_auto_out_in, OPT_BOOL) // mark booting auto-marked-out osds 'in'
 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
index c98bd30a9382313d47b23d4054c94c3b85827ead..ed7dc0c9666cf3d44c5d23cc5aa24e6abdd61375 100644 (file)
@@ -907,6 +907,10 @@ std::vector<Option> global_options = {
   .set_default(true)
   .set_description(""),
 
+  Option("mon_osd_destroyed_out_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+  .set_default(600)
+  .set_description(""),
+
   Option("mon_osd_down_out_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
   .set_default(600)
   .set_description(""),
index 94b0e5b7936c14edd420472658102b6bdd7fe015..934d215d981b2987383d22ad34fe9be89abdb942 100644 (file)
@@ -3362,8 +3362,15 @@ void OSDMonitor::tick()
          }
        }
 
-       if (g_conf->mon_osd_down_out_interval > 0 &&
-           down.sec() >= grace) {
+        bool down_out = !osdmap.is_destroyed(o) &&
+          g_conf->mon_osd_down_out_interval > 0 && down.sec() >= grace;
+        bool destroyed_out = osdmap.is_destroyed(o) &&
+          g_conf->mon_osd_destroyed_out_interval > 0 &&
+        // this is not precise enough as we did not make a note when this osd
+        // was marked as destroyed, but let's not bother with that
+        // complexity for now.
+          down.sec() >= g_conf->mon_osd_destroyed_out_interval;
+        if (down_out || destroyed_out) {
          dout(10) << "tick marking osd." << o << " OUT after " << down
                   << " sec (target " << grace << " = " << orig_grace << " + " << my_grace << ")" << dendl;
          pending_inc.new_weight[o] = CEPH_OSD_OUT;