]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: handle negative decay counter 28452/head
authorPatrick Donnelly <pdonnell@redhat.com>
Sat, 2 Feb 2019 00:00:13 +0000 (16:00 -0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 24 Oct 2019 15:54:50 +0000 (17:54 +0200)
Problem only exists in Luminous/Mimic.

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

src/mds/Beacon.cc

index 48c5ed2b536254070d9c3117c2d560f7469fba3a..d7643c9c5e04c65336f343d0ee0abc34176a9a34 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "Beacon.h"
 
+#include <math.h>
 #include <chrono>
 
 #define dout_context g_ceph_context
@@ -397,7 +398,7 @@ void Beacon::notify_health(MDSRank const *mds)
     std::list<MDSHealthMetric> late_recall_metrics;
     std::list<MDSHealthMetric> large_completed_requests_metrics;
     for (auto& session : sessions) {
-      const uint64_t recall_caps = session->get_recall_caps();
+      const uint64_t recall_caps = fmax(0.0, session->get_recall_caps()); /* In Luminous: decay counter may go negative due to hit */
       if (recall_caps > recall_warning_threshold) {
         dout(2) << "Session " << *session <<
              " is not releasing caps fast enough. Recalled caps at " << recall_caps