From 64362ac21d51ed15d41d337297126c24707ac709 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Mon, 30 Jul 2018 09:22:32 +0800 Subject: [PATCH] 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 --- src/osd/OSD.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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! + } } } } -- 2.39.5