]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add config to disable fragmentation
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 17 Apr 2018 03:14:27 +0000 (20:14 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 17 Apr 2018 18:26:56 +0000 (11:26 -0700)
For disaster situations or testing.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/common/options.cc
src/mds/MDBalancer.cc

index fb6914d0dda679f3ede491af561ccdb15c1d0ac4..71a1cd65ca9a14544bb1eccfba80afb6a24dacba 100644 (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."),
index 0b9d48dab3cd4d26f3ddea42c09d9711945d1438..e6bf839b218b0c8976754a17fe231d25e389a25a 100644 (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()) {