]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSD.cc: force updating heartbeat peers periodically 23487/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 30 Jul 2018 01:22:32 +0000 (09:22 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 9 Aug 2018 00:44:59 +0000 (08:44 +0800)
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 <xie.xingguo@zte.com.cn>
src/osd/OSD.cc

index d699f1f63045fa54d8cd609b63ef7fd1e1beee57..5d7b2c3412a3abea72bf8f86c46eb1cff37ee9ba 100644 (file)
@@ -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!
+        }
       }
     }
   }