From: Jianyu Li Date: Tue, 12 Dec 2017 07:20:44 +0000 (+0800) Subject: simplify mds overload judgement logic X-Git-Tag: v13.0.2~708^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e5ca899260ca3e889448c9cb1c583f575145e390;p=ceph-ci.git simplify mds overload judgement logic Signed-off-by: Jianyu Li --- diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 85aeab8645e..d7fdf561bc3 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -664,11 +664,13 @@ void MDBalancer::prep_rebalance(int beat) dout(15) << " mds." << it->second << " is importer" << dendl; importers.insert(pair(it->first,it->second)); importer_set.insert(it->second); - } else if ((it->first > target_load * (1.0 + g_conf->mds_bal_min_rebalance)) && - (it->second == whoami || !mds_last_epoch_under_info[it->second] || beat_epoch - mds_last_epoch_under_info[it->second] >= 2)){ - dout(15) << " mds." << it->second << " is exporter" << dendl; - exporters.insert(pair(it->first,it->second)); - exporter_set.insert(it->second); + } else if (it->first > target_load * (1.0 + g_conf->mds_bal_min_rebalance)) { + int mds_last_epoch_under = (it->second == whoami) ? 0 : mds_last_epoch_under_info[it->second]; + if (!mds_last_epoch_under || beat_epoch - mds_last_epoch_under >= 2) { + dout(15) << " mds." << it->second << " is exporter" << dendl; + exporters.insert(pair(it->first,it->second)); + exporter_set.insert(it->second); + } } }