]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: limit run time of load balancer
authorYan, Zheng <zyan@redhat.com>
Tue, 3 Apr 2018 04:21:07 +0000 (12:21 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 19 Apr 2018 00:10:27 +0000 (08:10 +0800)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit fc0d340876fbcd7d1d262c00b987849c052a296d)

src/mds/MDBalancer.cc

index 435d546d42f26766de20bfbeacad565854555e66..83de7910648aaabd8cfbd71b012279f9623b4f8c 100644 (file)
@@ -969,6 +969,13 @@ void MDBalancer::find_exports(CDir *dir,
                               double& have,
                               set<CDir*>& already_exporting)
 {
+  utime_t now = ceph_clock_now();
+  if ((double)(now - rebalance_time) > 0.1) {
+    derr << " balancer runs too long"  << dendl_impl;
+    have = amount;
+    return;
+  }
+
   assert(dir->is_auth());
 
   double need = amount - have;