]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDBalancer: remove useless check_targets and hit_targets logic from MDS balancer 15407/head
authorZhi Zhang <willzzhang@tencent.com>
Fri, 2 Jun 2017 05:07:21 +0000 (13:07 +0800)
committerZhi Zhang <willzzhang@tencent.com>
Fri, 2 Jun 2017 05:07:21 +0000 (13:07 +0800)
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 <zhangz.david@outlook.com>
src/mds/MDBalancer.cc
src/mds/MDBalancer.h

index 17a055154aa2a65bf6ba378411ff2cab9cd95062..c9e550317fab3897d7060cda695186515b118773 100644 (file)
@@ -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<CDir*>& exports,
index cbfc1c479ff193b9cf137af4e3b79b94a093b6dc..1f8d0dd1e607ecadd2e2f384985021ae94e9457c 100644 (file)
@@ -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,