From: xie xingguo Date: Mon, 30 Jul 2018 01:22:32 +0000 (+0800) Subject: osd/OSD.cc: force updating heartbeat peers periodically X-Git-Tag: v14.0.1~633^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=64362ac21d51ed15d41d337297126c24707ac709;p=ceph-ci.git osd/OSD.cc: force updating heartbeat peers periodically Because the cluster topology may change (e.g., because we add some new racks, hosts and disks) and we want the existing osds are then aware of new incoming osds, guaranteeing osds are always trying to do heartbeat as wide as possible(e.g., across all racks, hosts etc.). Signed-off-by: xie xingguo --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index d699f1f6304..5d7b2c3412a 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4306,7 +4306,7 @@ void OSD::maybe_update_heartbeat_peers() { assert(osd_lock.is_locked()); - if (is_waiting_for_healthy()) { + if (is_waiting_for_healthy() || is_active()) { utime_t now = ceph_clock_now(); if (last_heartbeat_resample == utime_t()) { last_heartbeat_resample = now; @@ -4317,7 +4317,9 @@ void OSD::maybe_update_heartbeat_peers() dout(10) << "maybe_update_heartbeat_peers forcing update after " << dur << " seconds" << dendl; heartbeat_set_peers_need_update(); last_heartbeat_resample = now; - reset_heartbeat_peers(); // we want *new* peers! + if (is_waiting_for_healthy()) { + reset_heartbeat_peers(); // we want *new* peers! + } } } }