From: Yongseok Oh Date: Fri, 24 Sep 2021 06:04:55 +0000 (+0000) Subject: mds: improve mds_bal_fragment_size_max config option X-Git-Tag: v17.1.0~543^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=29fa2cec790b5a68d9a8edf48cb47ca69d08c6cc;p=ceph.git mds: improve mds_bal_fragment_size_max config option 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 --- diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 190a53706455d..f870c61fe5d91 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -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", diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 095001076220f..1ed15937013c7 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -263,6 +263,7 @@ Server::Server(MDSRank *m, MetricsHandler *metrics_handler) : max_caps_throttle_ratio = g_conf().get_val("mds_session_max_caps_throttle_ratio"); caps_throttle_retry_request_timeout = g_conf().get_val("mds_cap_acquisition_throttle_retry_request_timeout"); dir_max_entries = g_conf().get_val("mds_dir_max_entries"); + bal_fragment_size_max = g_conf().get_val("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& 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("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); diff --git a/src/mds/Server.h b/src/mds/Server.h index 31ed68c45aeb9..76f38717c7265 100644 --- a/src/mds/Server.h +++ b/src/mds/Server.h @@ -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;