From 6e80b5035c73f23f2bece73b70a827b35d9b36e0 Mon Sep 17 00:00:00 2001 From: Zhi Zhang Date: Fri, 2 Jun 2017 13:07:21 +0800 Subject: [PATCH] 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 --- src/mds/MDBalancer.cc | 24 ------------------------ src/mds/MDBalancer.h | 2 -- 2 files changed, 26 deletions(-) diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 17a055154aa2a..c9e550317fab3 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 cbfc1c479ff19..1f8d0dd1e607e 100644 --- a/src/mds/MDBalancer.h +++ b/src/mds/MDBalancer.h @@ -89,8 +89,6 @@ class MDBalancer { 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,