]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't try exporting dirfrags under mds's own mdsdir
authorYan, Zheng <zyan@redhat.com>
Wed, 6 Dec 2017 05:37:19 +0000 (13:37 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 19 Apr 2018 00:10:26 +0000 (08:10 +0800)
Migrator will refuse to export them. Besides, stray directory can
never be subtree root.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit bb6d381f30bd8b51651db813d5b19ac7137ec773)

src/mds/MDBalancer.cc

index b8cf928b653724459734e25c3929e268b0e290d8..4a27b015a24130032e1ed73d7844be19196c00f9 100644 (file)
@@ -822,7 +822,8 @@ void MDBalancer::try_rebalance(balance_state_t& state)
   mds->mdcache->get_fullauth_subtrees(fullauthsubs);
   for (auto dir : fullauthsubs) {
     CInode *diri = dir->get_inode();
-    if (diri->is_stray()) continue;
+    if (diri->is_mdsdir())
+      continue;
 
     mds_rank_t from = diri->authority().first;
     double pop = dir->pop_auth_subtree.meta_load(rebalance_time, mds->mdcache->decayrate);
@@ -872,10 +873,10 @@ void MDBalancer::try_rebalance(balance_state_t& state)
        dout(5) << "considering " << *dir << " from " << (*p.first).first << dendl;
        multimap<mds_rank_t,CDir*>::iterator plast = p.first++;
 
-       if (dir->inode->is_base() ||
-           dir->inode->is_stray())
+       if (dir->inode->is_base())
          continue;
-       if (dir->is_freezing() || dir->is_frozen()) continue;  // export pbly already in progress
+       if (dir->is_freezing() || dir->is_frozen())
+         continue;  // export pbly already in progress
        double pop = dir->pop_auth_subtree.meta_load(rebalance_time, mds->mdcache->decayrate);
        assert(dir->inode->authority().first == target);  // cuz that's how i put it in the map, dummy
 
@@ -901,7 +902,7 @@ void MDBalancer::try_rebalance(balance_state_t& state)
     list<CDir*> exports;
 
     for (auto dir : fullauthsubs) {
-      if (dir->get_inode()->is_stray())
+      if (dir->get_inode()->is_mdsdir())
        continue;
       find_exports(dir, amount, exports, have, already_exporting);
       if (have > amount-MIN_OFFLOAD)