diff options
author | Martin Schwenke <martin@meltin.net> | 2011-07-22 20:24:28 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2011-07-29 14:32:07 +1000 |
commit | 85c0b10a38ed2152ff1401d791e09cf40c97ef46 (patch) | |
tree | ea42ba9445ad318304bcb3f3eb1af6dcc7b55601 /ctdb/tests/takeover | |
parent | d2ec92ba71b99a6a2e84aeb5a0784f134f6a3b0b (diff) | |
download | samba-85c0b10a38ed2152ff1401d791e09cf40c97ef46.tar.gz samba-85c0b10a38ed2152ff1401d791e09cf40c97ef46.tar.xz samba-85c0b10a38ed2152ff1401d791e09cf40c97ef46.zip |
IP allocation simulation - tighten up termination condition for -x.
When there are IP groups, do not terminate when the overall cluster
goes out of balance.
Also make explicit that grat_ip_moves is an integer not a boolean, so
only terminate if it is greater than 0.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 0899f14b1483682d73d1ee2d2419db54ffeadc4b)
Diffstat (limited to 'ctdb/tests/takeover')
-rwxr-xr-x | ctdb/tests/takeover/ctdb_takeover.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ctdb/tests/takeover/ctdb_takeover.py b/ctdb/tests/takeover/ctdb_takeover.py index 8f9cf6de71..e6dc19c770 100755 --- a/ctdb/tests/takeover/ctdb_takeover.py +++ b/ctdb/tests/takeover/ctdb_takeover.py @@ -799,6 +799,7 @@ class Cluster(object): self.prev = None self.prev = copy.deepcopy(self) - return grat_ip_moves or \ - imbalance > options.hard_limit or \ + # True is bad! + return (grat_ip_moves > 0) or \ + (not self.have_ip_groups() and imbalance > options.hard_limit) or \ (self.have_ip_groups() and (max(imbalance_groups) > options.hard_limit)) |