]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs: kill allow_dirfrags
authorDouglas Fuller <dfuller@redhat.com>
Wed, 4 Apr 2018 13:15:53 +0000 (09:15 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 17 Apr 2018 18:01:03 +0000 (11:01 -0700)
As dirfrags are now standard in CephFS, remove the machinery for
tracking and enabling this feature.

ceph fs set <fs> allow_dirfrags is now deprecated and prints a warning
message.

Signed-off-by: Douglas Fuller <dfuller@redhat.com>
14 files changed:
PendingReleaseNotes
doc/cephfs/dirfrags.rst
qa/tasks/ceph.py
qa/tasks/cephfs/filesystem.py
qa/tasks/cephfs/test_data_scan.py
qa/tasks/cephfs/test_fragment.py
qa/tasks/cephfs/test_strays.py
src/include/ceph_fs.h
src/mds/FSMap.cc
src/mds/MDBalancer.cc
src/mds/MDSMap.cc
src/mds/MDSMap.h
src/mds/MDSRank.cc
src/mon/FSCommands.cc

index 38bcc47fa8414d7fde706ec9bc78078af27b18c5..8330904b6b8758c06be2bf7db617ff317e72171a 100644 (file)
     default. ceph fs set allow_multimds is now deprecated and will be
     removed in a future release.
 
+  * As the directory fragmentation feature is now standard, it is now
+    enabled by default. ceph fs set allow_dirfrags is now deprecated and
+    will be removed in a future release.
+
   * New CephFS file system attributes session_timeout and session_autoclose
     are configurable via `ceph fs set`. The MDS config options
     mds_session_timeout, mds_session_autoclose, and mds_max_file_size are now
index 24b05edfc26841ff0b2cd3d149fdbe706bccd4cd..df0b24264cb8a374a3f9aa58e8bb8c976fc25d69 100644 (file)
@@ -25,10 +25,6 @@ fragments may be *merged* to reduce the number of fragments in the directory.
 Splitting and merging
 =====================
 
-An MDS will only consider doing splits if the allow_dirfrags setting is true in
-the file system map (set on the mons).  This setting is true by default since
-the *Luminous* release (12.2.X).
-
 When an MDS identifies a directory fragment to be split, it does not
 do the split immediately.  Because splitting interrupts metadata IO,
 a short delay is used to allow short bursts of client IO to complete
index 816191c5a78835fffaebe1624f20c2bc3b510b97..1990e10c2311a0ec813e5cf9d6968851e9752c4a 100644 (file)
@@ -377,7 +377,6 @@ def cephfs_setup(ctx, config):
         num_active = len([r for r in all_roles if is_active_mds(r)])
 
         fs.set_max_mds(num_active)
-        fs.set_allow_dirfrags(True)
 
     yield
 
index 64012e2994097eb1e923099cf1e2e672b14c1886..cc877d24e6299277dba7785775d081fc9877744b 100644 (file)
@@ -440,9 +440,6 @@ class Filesystem(MDSCluster):
     def set_max_mds(self, max_mds):
         self.set_var("max_mds", "%d" % max_mds)
 
-    def set_allow_dirfrags(self, yes):
-        self.set_var("allow_dirfrags", str(yes).lower(), '--yes-i-really-mean-it')
-
     def set_allow_new_snaps(self, yes):
         self.set_var("allow_new_snaps", str(yes).lower(), '--yes-i-really-mean-it')
 
index a2d315768aa03b6863c38c7bcedf6bb595ae0b6e..252354694c70c87f6794c96c223579704e2eed6d 100644 (file)
@@ -425,8 +425,6 @@ class TestDataScan(CephFSTestCase):
         That when injecting a dentry into a fragmented directory, we put it in the right fragment.
         """
 
-        self.fs.set_allow_dirfrags(True)
-
         file_count = 100
         file_names = ["%s" % n for n in range(0, file_count)]
 
index 54a49cea2fc6bccdea3ee158cfe83581a01fe30c..0ed5da281d255de072b63d6b70ce1359d3d2250d 100644 (file)
@@ -37,8 +37,6 @@ class TestFragmentation(CephFSTestCase):
         for k, v in kwargs.items():
             self.ceph_cluster.set_ceph_conf("mds", k, v.__str__())
 
-        self.fs.set_allow_dirfrags(True)
-
         self.mds_cluster.mds_fail_restart()
         self.fs.wait_for_daemons()
 
index 919b059b871ebf45de1a8a02c053b67277951cfb..ea73ae2c0917e3ced53cb34e28612e5a25c23538 100644 (file)
@@ -833,8 +833,6 @@ class TestStrays(CephFSTestCase):
         That unlinking fails when the stray directory fragment becomes too large and that unlinking may continue once those strays are purged.
         """
 
-        self.fs.set_allow_dirfrags(True)
-
         LOW_LIMIT = 50
         for mds in self.fs.get_daemon_names():
             self.fs.mds_asok(["config", "set", "mds_bal_fragment_size_max", str(LOW_LIMIT)], mds)
@@ -962,7 +960,6 @@ class TestStrays(CephFSTestCase):
 
         max_purge_files = 2
 
-        self.fs.set_allow_dirfrags(True)
         self.set_conf('mds', 'mds_max_purge_files', "%d" % max_purge_files)
         self.fs.mds_fail_restart()
         self.fs.wait_for_daemons()
index 3fada89a77db03c29163919ceed1ed220f6d4f98..060c890ae93051b87042d6f4c492410a8a8c2f70 100644 (file)
@@ -234,12 +234,9 @@ struct ceph_mon_subscribe_ack {
 #define CEPH_MDSMAP_DOWN    (1<<0)  /* cluster deliberately down */
 #define CEPH_MDSMAP_ALLOW_SNAPS   (1<<1)  /* cluster allowed to create snapshots */
 /* deprecated #define CEPH_MDSMAP_ALLOW_MULTIMDS (1<<2) cluster allowed to have >1 active MDS */
-#define CEPH_MDSMAP_ALLOW_DIRFRAGS (1<<3) /* cluster allowed to fragment directories */
+/* deprecated #define CEPH_MDSMAP_ALLOW_DIRFRAGS (1<<3) cluster allowed to fragment directories */
 
-#define CEPH_MDSMAP_ALLOW_CLASSICS (CEPH_MDSMAP_ALLOW_SNAPS | \
-                                   CEPH_MDSMAP_ALLOW_DIRFRAGS)
-
-#define CEPH_MDSMAP_DEFAULTS CEPH_MDSMAP_ALLOW_DIRFRAGS
+#define CEPH_MDSMAP_DEFAULTS 0
 
 /*
  * mds states
index a7e3cbcc1b77aa634dabe90c4ff4447366f05554..c41910d909854ff764ca8068fc43e409509f0f42 100644 (file)
@@ -503,7 +503,7 @@ void FSMap::decode(bufferlist::iterator& p)
        decode(legacy_mds_map.explicitly_allowed_features, p);
       }
     } else {
-      legacy_mds_map.ever_allowed_features = CEPH_MDSMAP_ALLOW_CLASSICS;
+      legacy_mds_map.ever_allowed_features = 0;
       legacy_mds_map.explicitly_allowed_features = 0;
     }
     if (ev >= 7)
index 4a6123f1792935750516469bb82d38be5baf5e1e..0b9d48dab3cd4d26f3ddea42c09d9711945d1438 100644 (file)
@@ -468,7 +468,6 @@ void MDBalancer::queue_split(const CDir *dir, bool fast)
   dout(10) << __func__ << " enqueuing " << *dir
                        << " (fast=" << fast << ")" << dendl;
 
-  assert(mds->mdsmap->allows_dirfrags());
   const dirfrag_t frag = dir->dirfrag();
 
   auto callback = [this, frag](int r) {
@@ -1124,10 +1123,7 @@ void MDBalancer::maybe_fragment(CDir *dir, bool hot)
       dir->is_auth()) {
 
     // split
-    if (g_conf->mds_bal_split_size > 0 &&
-       mds->mdsmap->allows_dirfrags() &&
-       (dir->should_split() || hot))
-    {
+    if (g_conf->mds_bal_split_size > 0 && (dir->should_split() || hot)) {
       if (split_pending.count(dir->dirfrag()) == 0) {
         queue_split(dir, false);
       } else {
index f47427383cf859aac537b0eb7ec5a759d3c1050c..db3d0561d98a6a419e3487a1f1a6707c7802f604 100644 (file)
@@ -755,7 +755,6 @@ void MDSMap::decode(bufferlist::iterator& p)
       bool flag;
       decode(flag, p);
       ever_allowed_features = flag ? CEPH_MDSMAP_ALLOW_SNAPS : 0;
-      ever_allowed_features |= CEPH_MDSMAP_ALLOW_DIRFRAGS;
       decode(flag, p);
       explicitly_allowed_features = flag ? CEPH_MDSMAP_ALLOW_SNAPS : 0;
     } else {
@@ -763,7 +762,7 @@ void MDSMap::decode(bufferlist::iterator& p)
       decode(explicitly_allowed_features, p);
     }
   } else {
-    ever_allowed_features = CEPH_MDSMAP_ALLOW_CLASSICS;
+    ever_allowed_features = 0;
     explicitly_allowed_features = 0;
   }
   if (ev >= 7)
index 2a8c1070dd5e67e9a3611e0bcdf18c227d3c5155..c92cf2bff2613d40eeb0727b599dacf8f3a61948 100644 (file)
@@ -282,14 +282,6 @@ public:
   void clear_snaps_allowed() { clear_flag(CEPH_MDSMAP_ALLOW_SNAPS); }
   bool allows_snaps() const { return test_flag(CEPH_MDSMAP_ALLOW_SNAPS); }
 
-  void set_dirfrags_allowed() {
-    set_flag(CEPH_MDSMAP_ALLOW_DIRFRAGS);
-    ever_allowed_features |= CEPH_MDSMAP_ALLOW_DIRFRAGS;
-    explicitly_allowed_features |= CEPH_MDSMAP_ALLOW_DIRFRAGS;
-  }
-  void clear_dirfrags_allowed() { clear_flag(CEPH_MDSMAP_ALLOW_DIRFRAGS); }
-  bool allows_dirfrags() const { return test_flag(CEPH_MDSMAP_ALLOW_DIRFRAGS); }
-
   epoch_t get_epoch() const { return epoch; }
   void inc_epoch() { epoch++; }
 
index 69055b8717a6a1586e3de93534db6e9522205d15..dd01e194ae959adf3438a60d996bb97df9d533af 100644 (file)
@@ -635,12 +635,10 @@ bool MDSRank::_dispatch(Message *m, bool new_msg)
     if (!dir->get_parent_dir()) continue;    // must be linked.
     if (!dir->is_auth()) continue;           // must be auth.
     frag_t fg = dir->get_frag();
-    if (mdsmap->allows_dirfrags()) {
-      if ((fg == frag_t() || (rand() % (1 << fg.bits()) == 0))) {
-        mdcache->split_dir(dir, 1);
-      } else {
-        balancer->queue_merge(dir);
-      }
+    if ((fg == frag_t() || (rand() % (1 << fg.bits()) == 0))) {
+      mdcache->split_dir(dir, 1);
+    } else {
+      balancer->queue_merge(dir);
     }
   }
 
@@ -2470,11 +2468,6 @@ bool MDSRank::command_dirfrag_split(
     std::ostream &ss)
 {
   Mutex::Locker l(mds_lock);
-  if (!mdsmap->allows_dirfrags()) {
-    ss << "dirfrags are disallowed by the mds map!";
-    return false;
-  }
-
   int64_t by = 0;
   if (!cmd_getval(g_ceph_context, cmdmap, "bits", by)) {
     ss << "missing bits argument";
index 03498e3a49e641f4a174d5cf67d2587c6911cd2e..a6dcd0763b1b5b439fbb3459d16e1132a78c7ad8 100644 (file)
@@ -372,28 +372,7 @@ public:
     } else if (var == "allow_multimds") {
           ss << "Multiple MDS is always enabled. Use the max_mds parameter to control the number of active MDSs allowed. This command is DEPRECATED and will be REMOVED from future releases.";
     } else if (var == "allow_dirfrags") {
-      bool enable_dirfrags = false;
-      int r = parse_bool(val, &enable_dirfrags, ss);
-      if (r != 0) {
-       return r;
-      }
-
-      if (!enable_dirfrags) {
-       fsmap.modify_filesystem(fs->fscid,
-            [](std::shared_ptr<Filesystem> fs)
-               {
-                 fs->mds_map.clear_dirfrags_allowed();
-               });
-       ss << "disallowed new directory fragmentation";
-      } else {
-        fsmap.modify_filesystem(
-            fs->fscid,
-            [](std::shared_ptr<Filesystem> fs)
-        {
-          fs->mds_map.set_dirfrags_allowed();
-        });
-       ss << "enabled directory fragmentation";
-      }
+       ss << "Directory fragmentation is now permanently enabled. This command is DEPRECATED and will be REMOVED from future releases.";
     } else if (var == "cluster_down") {
       bool is_down = false;
       int r = parse_bool(val, &is_down, ss);