Skip to content

Commit

Permalink
Merge pull request #15407 from david-z/wip-fix-mds-balancer
Browse files Browse the repository at this point in the history
mds/MDBalancer: remove useless check_targets and hit_targets logic from MDS balancer

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
  • Loading branch information
John Spray committed Jun 15, 2017
2 parents c15effa + 6e80b50 commit 0f2130e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
24 changes: 0 additions & 24 deletions src/mds/MDBalancer.cc
Expand Up @@ -733,15 +733,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;
Expand Down Expand Up @@ -797,9 +788,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;
Expand Down Expand Up @@ -950,18 +938,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,
Expand Down
2 changes: 0 additions & 2 deletions src/mds/MDBalancer.h
Expand Up @@ -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,
Expand Down

0 comments on commit 0f2130e

Please sign in to comment.