]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: wait shorter intervals if beacon not sent 25980/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 9 Oct 2018 22:50:22 +0000 (15:50 -0700)
committerPrashant D <pdhange@redhat.com>
Tue, 15 Jan 2019 23:33:49 +0000 (18:33 -0500)
MDS beacon upkeep always waits mds_beacon_interval seconds even when laggy.
Check more frequently for when we stop being laggy to reduce likelihood that
the MDS is removed.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 4014441b8d9ad446f01c3a59d6720bb888457330)

Conflicts:
src/mds/Beacon.h : Resolved for _send

src/mds/Beacon.cc
src/mds/Beacon.h

index a013c391398b4fcd51f1f592c35f102545969cc7..36e8c7c12cf5d3e795af2fd4c51d030c4d49e978 100644 (file)
@@ -80,7 +80,9 @@ void Beacon::init(MDSMap const *mdsmap)
       auto since = std::chrono::duration<double>(now-last_send).count();
       auto interval = beacon_interval;
       if (since >= interval*.90) {
-        _send();
+        if (!_send()) {
+          interval = 0.5; /* 500ms */
+        }
       } else {
         interval -= since;
       }
@@ -185,7 +187,7 @@ void Beacon::send_and_wait(const double duration)
 /**
  * Call periodically, or when you have updated the desired state
  */
-void Beacon::_send()
+bool Beacon::_send()
 {
   auto now = clock::now();
   auto since = std::chrono::duration<double>(now-last_acked_stamp).count();
@@ -194,7 +196,7 @@ void Beacon::_send()
     /* If anything isn't progressing, let avoid sending a beacon so that
      * the MDS will consider us laggy */
     dout(0) << "Skipping beacon heartbeat to monitors (last acked " << since << "s ago); MDS internal heartbeat is not healthy!" << dendl;
-    return;
+    return false;
   }
 
   ++last_seq;
@@ -227,6 +229,7 @@ void Beacon::_send()
   }
   monc->send_mon_message(beacon);
   last_send = now;
+  return true;
 }
 
 /**
index b7fbe27ec19c874772017effcba9ddfc4612e0e0..142de080074cbcb54000356b8b8ecb6e9a2188ac 100644 (file)
@@ -85,7 +85,7 @@ public:
 
 private:
   void _notify_mdsmap(MDSMap const *mdsmap);
-  void _send();
+  bool _send();
 
   mutable std::mutex mutex;
   std::thread sender;