]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: improve mds_bal_fragment_size_max config option 43296/head
authorYongseok Oh <yongseok.oh@linecorp.com>
Fri, 24 Sep 2021 06:04:55 +0000 (06:04 +0000)
committerYongseok Oh <yongseok.oh@linecorp.com>
Wed, 13 Oct 2021 07:39:23 +0000 (07:39 +0000)
mds_bal_fragment_size_max is maintained as bal_fragment_size_max cached
variable

Fixes: https://tracker.ceph.com/issues/52723
Signed-off-by: Yongseok Oh <yongseok.oh@linecorp.com>
src/mds/MDSRank.cc
src/mds/Server.cc
src/mds/Server.h

index 190a53706455d6075b24b57f2187c1d4bf9aed8a..f870c61fe5d9113bf31ef9b7b48d5dc23ab2864d 100644 (file)
@@ -3672,6 +3672,7 @@ const char** MDSRankDispatcher::get_tracked_conf_keys() const
     "host",
     "mds_bal_fragment_dirs",
     "mds_bal_fragment_interval",
+    "mds_bal_fragment_size_max",
     "mds_cache_memory_limit",
     "mds_cache_mid",
     "mds_cache_reservation",
index 095001076220f41d4eda6095d95843c5c2597623..1ed15937013c7b4c98b739cf10527b8de9ac8ba3 100644 (file)
@@ -263,6 +263,7 @@ Server::Server(MDSRank *m, MetricsHandler *metrics_handler) :
   max_caps_throttle_ratio = g_conf().get_val<double>("mds_session_max_caps_throttle_ratio");
   caps_throttle_retry_request_timeout = g_conf().get_val<double>("mds_cap_acquisition_throttle_retry_request_timeout");
   dir_max_entries = g_conf().get_val<uint64_t>("mds_dir_max_entries");
+  bal_fragment_size_max = g_conf().get_val<int64_t>("mds_bal_fragment_size_max");
   supported_features = feature_bitset_t(CEPHFS_FEATURES_MDS_SUPPORTED);
 }
 
@@ -1263,6 +1264,11 @@ void Server::handle_conf_change(const std::set<std::string>& changed) {
     dout(20) << __func__ << " max entries per directory changed to "
             << dir_max_entries << dendl;
   }
+  if (changed.count("mds_bal_fragment_size_max")) {
+    bal_fragment_size_max = g_conf().get_val<int64_t>("mds_bal_fragment_size_max");
+    dout(20) << __func__ << " max fragment size changed to "
+            << bal_fragment_size_max << dendl;
+  }
 }
 
 /*
@@ -3205,7 +3211,7 @@ bool Server::check_access(MDRequestRef& mdr, CInode *in, unsigned mask)
 bool Server::check_fragment_space(MDRequestRef &mdr, CDir *dir)
 {
   const auto size = dir->get_frag_size();
-  const auto max = g_conf()->mds_bal_fragment_size_max;
+  const auto max = bal_fragment_size_max;
   if (size >= max) {
     dout(10) << "fragment " << *dir << " size exceeds " << max << " (CEPHFS_ENOSPC)" << dendl;
     respond_to_request(mdr, -CEPHFS_ENOSPC);
index 31ed68c45aeb937062a0c096043c8fd89a8e0038..76f38717c7265b29ce783816eff3abb8afc65bb8 100644 (file)
@@ -461,6 +461,7 @@ private:
   uint64_t max_snaps_per_dir = 100;
   unsigned delegate_inos_pct = 0;
   uint64_t dir_max_entries = 0;
+  int64_t bal_fragment_size_max = 0;
 
   DecayCounter recall_throttle;
   time last_recall_state;