]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/balancer: cancel plan if distribution is already perfect
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 2 Feb 2018 07:24:21 +0000 (15:24 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 8 Feb 2018 05:42:54 +0000 (13:42 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit 3da5257a675e966e9b5748dc35373fc078c61a87)

src/pybind/mgr/balancer/module.py

index 2a14dcae7f2443a38d232dc1626d41d1b34fc19a..bf8d1143c8edd1956f659e19ca35fd261255d5c2 100644 (file)
@@ -679,6 +679,9 @@ class Module(MgrModule):
             if left <= 0:
                 break
         self.log.info('prepared %d/%d changes' % (total_did, max_iterations))
+        if total_did == 0:
+            return -errno.EALREADY, 'Unable to find further optimization,' \
+                                    'or distribution is already perfect'
         return 0, ''
 
     def do_crush_compat(self, plan):