]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix option mds_bal_overload_epochs 60686/head
authorZhansong Gao <zhsgao@hotmail.com>
Mon, 11 Nov 2024 05:26:03 +0000 (13:26 +0800)
committerVenky Shankar <vshankar@redhat.com>
Thu, 30 Jan 2025 04:12:09 +0000 (09:42 +0530)
When option mds_bal_overload_epochs was added, two positions
should have been modified, but one of them was overlooked.

Fixes: https://tracker.ceph.com/issues/68953
Signed-off-by: Zhansong Gao <zhsgao@hotmail.com>
src/mds/MDBalancer.cc

index 3fa4acca1b4408a41c44bab72f76ddb1d3e824cc..209dff4bb74557fcb67eaad36c829cf2b2016695 100644 (file)
@@ -830,8 +830,9 @@ void MDBalancer::prep_rebalance(int beat)
       dout(7) << "  i am underloaded or barely overloaded, doing nothing." << dendl;
       return;
     }
+    auto overload_epochs = g_conf().get_val<int64_t>("mds_bal_overload_epochs");
     // am i over long enough?
-    if (last_epoch_under && beat_epoch - last_epoch_under < g_conf()->mds_bal_overload_epochs) {
+    if (last_epoch_under && beat_epoch - last_epoch_under < overload_epochs) {
       dout(7) << "  i am overloaded, but only for " << (beat_epoch - last_epoch_under) << " epochs" << dendl;
       return;
     }
@@ -854,7 +855,7 @@ void MDBalancer::prep_rebalance(int beat)
        importer_set.insert(it->second);
       } else {
        int mds_last_epoch_under = mds_last_epoch_under_map[it->second];
-       if (!(mds_last_epoch_under && beat_epoch - mds_last_epoch_under < 2)) {
+       if (!(mds_last_epoch_under && beat_epoch - mds_last_epoch_under < overload_epochs)) {
          dout(15) << "   mds." << it->second << " is exporter" << dendl;
          exporters.insert(pair<double,mds_rank_t>(it->first,it->second));
          exporter_set.insert(it->second);