]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add working set minimum for caps
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 6 Aug 2020 16:04:23 +0000 (09:04 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 7 Aug 2020 05:17:58 +0000 (22:17 -0700)
A client may hold many inodes pinned in its cache for open files. That
client may be unable to release those caps to respond to cache pressure
from the MDS (or quiescent client cap recall). We should not complain if
that number of capabilities is reasonable (< 10k by default).

Fixes: https://tracker.ceph.com/issues/46830
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 63392e1b65fbead6ef8c7acd6a70e6ef5b322390)

src/common/options.cc
src/mds/Beacon.cc
src/mds/SessionMap.h

index e763a5f5bc4196cd9bd8f72e92faf972e3ba36ae..f6366ddf2591bb4be57c8b96dcacf6b7e800f2b5 100644 (file)
@@ -8175,6 +8175,11 @@ std::vector<Option> get_mds_options() {
     .set_default(100)
     .set_description("minimum number of capabilities a client may hold"),
 
+    Option("mds_min_caps_working_set", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    .set_default(10000)
+    .set_flag(Option::FLAG_RUNTIME)
+    .set_description("number of capabilities a client may hold without cache pressure warnings generated"),
+
     Option("mds_max_caps_per_client", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
     .set_default(1_M)
     .set_description("maximum number of capabilities a client may hold"),
index b374171c57a9d38cb1593e213a6ad9ae089302e1..b66550bdab90f29a7db50737b79d75a0282238ad 100644 (file)
@@ -367,14 +367,16 @@ void Beacon::notify_health(MDSRank const *mds)
     set<Session*> sessions;
     mds->sessionmap.get_client_session_set(sessions);
 
+    const auto min_caps_working_set = g_conf().get_val<uint64_t>("mds_min_caps_working_set");
     const auto recall_warning_threshold = g_conf().get_val<Option::size_t>("mds_recall_warning_threshold");
     const auto max_completed_requests = g_conf()->mds_max_completed_requests;
     const auto max_completed_flushes = g_conf()->mds_max_completed_flushes;
     std::list<MDSHealthMetric> late_recall_metrics;
     std::list<MDSHealthMetric> large_completed_requests_metrics;
     for (auto& session : sessions) {
+      const uint64_t num_caps = session->get_num_caps();
       const uint64_t recall_caps = session->get_recall_caps();
-      if (recall_caps > recall_warning_threshold) {
+      if (recall_caps > recall_warning_threshold && num_caps > min_caps_working_set) {
         dout(2) << "Session " << *session <<
              " is not releasing caps fast enough. Recalled caps at " << recall_caps
           << " > " << recall_warning_threshold << " (mds_recall_warning_threshold)." << dendl;
index fd2ba781e6c680e26222e4df7424037c5946e39d..f14dfb4dc36bbf8e9150b07e128062aba43cdbda 100644 (file)
@@ -388,6 +388,10 @@ public:
     return info.completed_flushes.count(tid);
   }
 
+  uint64_t get_num_caps() const {
+    return caps.size();
+  }
+
   unsigned get_num_completed_flushes() const { return info.completed_flushes.size(); }
   unsigned get_num_trim_flushes_warnings() const {
     return num_trim_flushes_warnings;