From: Patrick Donnelly Date: Tue, 9 Oct 2018 22:50:22 +0000 (-0700) Subject: mds: wait shorter intervals if beacon not sent X-Git-Tag: v12.2.12~78^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=861b438445f40156253a1edc17b252a8034ece64;p=ceph.git mds: wait shorter intervals if beacon not sent 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 (cherry picked from commit 4014441b8d9ad446f01c3a59d6720bb888457330) Conflicts: src/mds/Beacon.h : Resolved for _send --- diff --git a/src/mds/Beacon.cc b/src/mds/Beacon.cc index 475169a1604..891487f2abb 100644 --- a/src/mds/Beacon.cc +++ b/src/mds/Beacon.cc @@ -78,7 +78,9 @@ void Beacon::init(const MDSMap* mdsmap) auto since = std::chrono::duration(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(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; } /** diff --git a/src/mds/Beacon.h b/src/mds/Beacon.h index bf5afa2c8b0..7120752fa0b 100644 --- a/src/mds/Beacon.h +++ b/src/mds/Beacon.h @@ -85,7 +85,7 @@ public: private: void _notify_mdsmap(MDSMap const *mdsmap); - void _send(); + bool _send(); mutable std::mutex mutex; std::thread sender;