]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: wait shorter intervals if beacon not sent 25979/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:37:00 +0000 (18:37 -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 475169a1604e05311d6942194dd87e473f646555..891487f2abb8601cbc1978e9d2e8da08f695aab1 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;
       }
@@ -183,7 +185,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();
@@ -192,7 +194,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;
@@ -225,6 +227,7 @@ void Beacon::_send()
   }
   monc->send_mon_message(beacon);
   last_send = now;
+  return true;
 }
 
 /**
index bf5afa2c8b08a2297f332616943a9aa7027e347f..7120752fa0b87103d4582e86893cbeaabe2ff639 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;