From: Zengran Zhang Date: Tue, 5 Jan 2016 09:11:27 +0000 (-0500) Subject: mon/OSDMonitor: osdmap laggy set a maximum limit for interval X-Git-Tag: v10.0.3~71^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f11ad56cb9ee3e7ca6d1e9b01426bfb042dda76d;p=ceph.git mon/OSDMonitor: osdmap laggy set a maximum limit for interval 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 --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 26fae376a5c0..715dd069128b 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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' diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index bf7d5d7136b9..77e26de70a9f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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); }