Merge PR #43296 into master

* refs/pull/43296/head:
	mds: improve mds_bal_fragment_size_max config option

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
This commit is contained in:
Patrick Donnelly 2021-11-01 14:48:06 -04:00
commit b8c036f034
No known key found for this signature in database
GPG Key ID: BE69BB7D36E459B4
3 changed files with 9 additions and 1 deletions

View File

@ -3678,6 +3678,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",

View 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);

View 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;