]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: osdmap laggy set a maximum limit for interval 7109/head
authorZengran Zhang <zhangzengran@h3c.com>
Tue, 5 Jan 2016 09:11:27 +0000 (04:11 -0500)
committerZengran Zhang <zhangzengran@h3c.com>
Tue, 5 Jan 2016 09:11:27 +0000 (04:11 -0500)
when the OSD down too long then up,the value of laggy_interval is too big.
this cause next down will be too lag.

Signed-off-by: Zengran Zhang <zhangzengran@h3c.com>
src/common/config_opts.h
src/mon/OSDMonitor.cc

index 26fae376a5c05c2189f9f28528ae050666b34042..715dd069128b9fb937c0a45a13331d189f30521d 100644 (file)
@@ -207,6 +207,7 @@ OPTION(mon_subscribe_interval, OPT_DOUBLE, 24*3600)  // for legacy clients only
 OPTION(mon_delta_reset_interval, OPT_DOUBLE, 10)   // seconds of inactivity before we reset the pg delta to 0
 OPTION(mon_osd_laggy_halflife, OPT_INT, 60*60)        // (seconds) how quickly our laggy estimations decay
 OPTION(mon_osd_laggy_weight, OPT_DOUBLE, .3)          // weight for new 'samples's in laggy estimations
+OPTION(mon_osd_laggy_max_interval, OPT_INT, 300)      // maximum value of laggy_interval in laggy estimations
 OPTION(mon_osd_adjust_heartbeat_grace, OPT_BOOL, true)    // true if we should scale based on laggy estimations
 OPTION(mon_osd_adjust_down_out_interval, OPT_BOOL, true)  // true if we should scale based on laggy estimations
 OPTION(mon_osd_auto_mark_in, OPT_BOOL, false)         // mark any booting osds 'in'
index bf7d5d7136b9707adfdf610399e12aad2495c30d..77e26de70a9f1b26e6c20e7cfee0a439e2b3b60e 100644 (file)
@@ -2067,8 +2067,11 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op)
       dout(10) << " not laggy, new xi " << xi << dendl;
     } else {
       if (xi.down_stamp.sec()) {
-       int interval = ceph_clock_now(g_ceph_context).sec() - xi.down_stamp.sec();
-       xi.laggy_interval =
+        int interval = ceph_clock_now(g_ceph_context).sec() - xi.down_stamp.sec();
+        if (g_conf->mon_osd_laggy_max_interval && (interval > g_conf->mon_osd_laggy_max_interval)) {
+          interval =  g_conf->mon_osd_laggy_max_interval;
+        }
+        xi.laggy_interval =
          interval * g_conf->mon_osd_laggy_weight +
          xi.laggy_interval * (1.0 - g_conf->mon_osd_laggy_weight);
       }