From: Yan, Zheng Date: Wed, 6 Dec 2017 05:37:19 +0000 (+0800) Subject: mds: don't try exporting dirfrags under mds's own mdsdir X-Git-Tag: v12.2.6~41^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7398a7bca9be6dd7fad1258e6b8a27c0efebecb6;p=ceph.git mds: don't try exporting dirfrags under mds's own mdsdir Migrator will refuse to export them. Besides, stray directory can never be subtree root. Signed-off-by: "Yan, Zheng" (cherry picked from commit bb6d381f30bd8b51651db813d5b19ac7137ec773) --- diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index b8cf928b65372..4a27b015a2413 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -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::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 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)