From 15810b436051c220e983b9b6cc268f2bc14acc2d Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Tue, 3 Apr 2018 11:29:54 +0800 Subject: [PATCH] mds: don't try exporting subdir if dirfrag is already being exported It doesn't make sense to call MDBalancer::find_exports() for a dirfrag that is already being exported. Signed-off-by: "Yan, Zheng" --- src/mds/MDBalancer.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index c0cea34efa9..229092308ee 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -909,6 +909,8 @@ void MDBalancer::try_rebalance(balance_state_t& state) for (auto dir : fullauthsubs) { if (dir->get_inode()->is_mdsdir()) continue; + if (dir->is_freezing() || dir->is_frozen()) + continue; // export pbly already in progress find_exports(dir, amount, exports, have, already_exporting); if (have > amount-MIN_OFFLOAD) break; @@ -962,7 +964,7 @@ void MDBalancer::find_exports(CDir *dir, if (!subdir->is_auth()) continue; if (already_exporting.count(subdir)) continue; - if (subdir->is_frozen()) continue; // can't export this right now! + if (subdir->is_frozen() || subdir->is_freezing()) continue; // can't export this right now! // how popular? double pop = subdir->pop_auth_subtree.meta_load(rebalance_time, mds->mdcache->decayrate); -- 2.39.5