mds: add config to disable fragmentation

For disaster situations or testing.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2018-04-16 20:14:27 -07:00
parent dde9ee1628
commit c9a590574c
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB
2 changed files with 8 additions and 1 deletions

View File

@ -6670,6 +6670,11 @@ std::vector<Option> get_mds_options() {
.set_default(1.5)
.set_description("ratio of mds_bal_split_size at which fast fragment splitting occurs"),
Option("mds_bal_fragment_dirs", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(true)
.set_description("enable directory fragmentation")
.set_long_description("Directory fragmentation is a standard feature of CephFS that allows sharding directories across multiple objects for performance and stability. Additionally, this allows fragments to be distributed across multiple active MDSs to increase throughput. Disabling (new) fragmentation should only be done in exceptional circumstances and may lead to performance issues."),
Option("mds_bal_idle_threshold", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
.set_default(0)
.set_description("idle metadata popularity threshold before rebalancing"),
@ -6933,6 +6938,7 @@ std::vector<Option> get_mds_options() {
Option("mds_max_ratio_caps_per_client", Option::TYPE_FLOAT, Option::LEVEL_DEV)
.set_default(.8)
.set_description("maximum ratio of current caps that may be recalled during MDS cache pressure"),
Option("mds_hack_allow_loading_invalid_metadata", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
.set_default(0)
.set_description("INTENTIONALLY CAUSE DATA LOSS by bypasing checks for invalid metadata on disk. Allows testing repair tools."),

View File

@ -1118,7 +1118,8 @@ void MDBalancer::hit_inode(const utime_t& now, CInode *in, int type, int who)
void MDBalancer::maybe_fragment(CDir *dir, bool hot)
{
// split/merge
if (g_conf->mds_bal_fragment_interval > 0 &&
if (mds->cct->_conf->get_val<bool>("mds_bal_fragment_dirs") &&
g_conf->mds_bal_fragment_interval > 0 &&
!dir->inode->is_base() && // not root/base (for now at least)
dir->is_auth()) {