From c0b3a1148475ea7e563b1b8c13217b6e7c85b150 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Mon, 28 Jan 2019 15:48:38 -0800 Subject: [PATCH] mds: simplify recall warnings Instead of a timeout and complicated decisions about whether the client is releasing caps in an expeditious fashion, just use a DecayCounter that tracks the number of caps we've recalled. This counter is decremented whenever the client releases caps. If the counter passes a threshold, then we raise the warning. Similar reworking is done for the steady-state recall of client caps. Another release DecayCounter is added so we can tell when the client is not releasing any more caps. Signed-off-by: Patrick Donnelly --- PendingReleaseNotes | 6 +++ qa/tasks/cephfs/test_client_limits.py | 9 ++-- src/common/legacy_config_opts.h | 1 - src/common/options.cc | 10 ++-- src/mds/Beacon.cc | 47 ++++++------------- src/mds/Server.cc | 66 ++++++++++++++++----------- src/mds/Server.h | 2 +- src/mds/SessionMap.cc | 45 ++++++------------ src/mds/SessionMap.h | 35 ++++++++------ 9 files changed, 110 insertions(+), 111 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index e04ce58793165..50bc4831ba825 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -179,6 +179,12 @@ MDS when all of these caps need to be processed during certain session events. It is recommended to not unnecessarily increase this value. +* The MDS config mds_recall_state_timeout has been removed. Late client recall + warnings are now generated based on the number of caps the MDS has recalled + which have not been released. The new configs mds_recall_warning_threshold + (default: 32K) and mds_recall_warning_decay_rate (default: 60s) sets the + threshold for this warning. + >=13.1.0 -------- diff --git a/qa/tasks/cephfs/test_client_limits.py b/qa/tasks/cephfs/test_client_limits.py index 833a37172569f..bc029cd8a5ab8 100644 --- a/qa/tasks/cephfs/test_client_limits.py +++ b/qa/tasks/cephfs/test_client_limits.py @@ -42,10 +42,13 @@ class TestClientLimits(CephFSTestCase): cache_size = open_files/2 self.set_conf('mds', 'mds cache size', cache_size) + self.set_conf('mds', 'mds_recall_max_caps', open_files/2) + self.set_conf('mds', 'mds_recall_warning_threshold', open_files) self.fs.mds_fail_restart() self.fs.wait_for_daemons() mds_min_caps_per_client = int(self.fs.get_config("mds_min_caps_per_client")) + mds_recall_warning_decay_rate = self.fs.get_config("mds_recall_warning_decay_rate") self.assertTrue(open_files >= mds_min_caps_per_client) mount_a_client_id = self.mount_a.get_global_id() @@ -63,13 +66,11 @@ class TestClientLimits(CephFSTestCase): # MDS should not be happy about that, as the client is failing to comply # with the SESSION_RECALL messages it is being sent - mds_recall_state_timeout = float(self.fs.get_config("mds_recall_state_timeout")) - self.wait_for_health("MDS_CLIENT_RECALL", mds_recall_state_timeout+10) + self.wait_for_health("MDS_CLIENT_RECALL", mds_recall_warning_decay_rate*2) # We can also test that the MDS health warning for oversized # cache is functioning as intended. - self.wait_for_health("MDS_CACHE_OVERSIZED", - mds_recall_state_timeout + 10) + self.wait_for_health("MDS_CACHE_OVERSIZED", mds_recall_warning_decay_rate*2) # When the client closes the files, it should retain only as many caps as allowed # under the SESSION_RECALL policy diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 21d7204980473..a71d2dac51a36 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -410,7 +410,6 @@ OPTION(mds_session_blacklist_on_timeout, OPT_BOOL) // whether to blacklist cl OPTION(mds_session_blacklist_on_evict, OPT_BOOL) // whether to blacklist clients whose sessions are dropped via admin commands OPTION(mds_sessionmap_keys_per_op, OPT_U32) // how many sessions should I try to load/store in a single OMAP operation? -OPTION(mds_recall_state_timeout, OPT_FLOAT) // detect clients which aren't trimming caps OPTION(mds_freeze_tree_timeout, OPT_FLOAT) // detecting freeze tree deadlock OPTION(mds_health_summarize_threshold, OPT_INT) // collapse N-client health metrics to a single 'many' OPTION(mds_reconnect_timeout, OPT_FLOAT) // seconds to wait for clients during mds restart diff --git a/src/common/options.cc b/src/common/options.cc index 547b8b8757a33..245cac9af8f12 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -7247,9 +7247,13 @@ std::vector