Merge pull request #20194 from xiexingguo/wip-badsteps

pybind/mgr/balancer: increase bad_steps properly

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Kefu Chai 2018-02-02 15:55:41 +08:00 committed by GitHub
commit 43a2b00308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -785,6 +785,7 @@ class Module(MgrModule):
next_misplaced, max_misplaced, step)
else:
if next_pe.score > best_pe.score * 1.0001:
bad_steps += 1
if bad_steps < 5 and random.randint(0, 100) < 70:
self.log.debug('Score got worse, taking another step')
else: