From: Zhi Zhang Date: Fri, 2 Jun 2017 05:07:21 +0000 (+0800) Subject: mds/MDBalancer: remove useless check_targets and hit_targets logic from MDS balancer X-Git-Tag: v12.1.0~124^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F15407%2Fhead;p=ceph.git mds/MDBalancer: remove useless check_targets and hit_targets logic from MDS balancer Currently the logic that check and hit export targets has been moved to Migrator. So remove the check_targets and hit_targets logic still remaining in MDS balancer which causes MDS failing to do rebalance. Signed-off-by: Zhi Zhang --- diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 17a055154aa..c9e550317fa 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -730,15 +730,6 @@ void MDBalancer::prep_rebalance(int beat) try_rebalance(state); } -void MDBalancer::hit_targets(const balance_state_t& state) -{ - utime_t now = ceph_clock_now(); - for (auto &it : state.targets) { - mds_rank_t target = it.first; - mds->hit_export_target(now, target, g_conf->mds_bal_target_decay); - } -} - int MDBalancer::mantle_prep_rebalance() { balance_state_t state; @@ -794,9 +785,6 @@ int MDBalancer::mantle_prep_rebalance() void MDBalancer::try_rebalance(balance_state_t& state) { - if (!check_targets(state)) - return; - if (g_conf->mds_thrash_exports) { dout(5) << "mds_thrash is on; not performing standard rebalance operation!" << dendl; @@ -947,18 +935,6 @@ void MDBalancer::try_rebalance(balance_state_t& state) mds->mdcache->show_subtrees(); } - -/* Check that all targets are in the MDSMap export_targets for my rank. */ -bool MDBalancer::check_targets(const balance_state_t& state) -{ - for (const auto &it : state.targets) { - if (!mds->is_export_target(it.first)) { - return false; - } - } - return true; -} - void MDBalancer::find_exports(CDir *dir, double amount, list& exports, diff --git a/src/mds/MDBalancer.h b/src/mds/MDBalancer.h index cbfc1c479ff..1f8d0dd1e60 100644 --- a/src/mds/MDBalancer.h +++ b/src/mds/MDBalancer.h @@ -89,8 +89,6 @@ private: void export_empties(); int localize_balancer(); - bool check_targets(const balance_state_t& state); - void hit_targets(const balance_state_t& state); void send_heartbeat(); void handle_heartbeat(MHeartbeat *m); void find_exports(CDir *dir,