]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: wait shorter intervals if beacon not sent 24505/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 9 Oct 2018 22:50:22 +0000 (15:50 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 16 Oct 2018 13:29:35 +0000 (06:29 -0700)
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>
src/mds/Beacon.cc
src/mds/Beacon.h

index 8d54a8218ec35fd634b0b40709f4969185b40db3..52c9a9bb71b225f3e675b434e222292462c7515d 100644 (file)
@@ -78,7 +78,9 @@ void Beacon::init(const MDSMap &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;
       }
@@ -179,7 +181,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();
@@ -188,7 +190,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;
@@ -221,6 +223,7 @@ void Beacon::_send()
   }
   monc->send_mon_message(beacon.detach());
   last_send = now;
+  return true;
 }
 
 /**
index a06df4cbe68d8e9776e1ab325c64587002c13ccf..f01fba2a1ee5aa1fd154f2ee2153a13e16ff416e 100644 (file)
@@ -84,7 +84,7 @@ public:
 
 private:
   void _notify_mdsmap(const MDSMap &mdsmap);
-  void _send();
+  bool _send();
 
   mutable std::mutex mutex;
   std::thread sender;