[SCM] CTDB repository - branch master updated - ctdb-1.0.114-199-g974f849

Ronnie Sahlberg sahlberg at samba.org
Sun Aug 1 23:47:20 MDT 2010


The branch, master has been updated
       via  974f849df0aca2cfedb38fa815894955e32803a8 (commit)
       via  0a2a5602233a8208e2729192e50d816faed0151a (commit)
       via  d382d9023928f75f360a115ae1e9c1036423416e (commit)
       via  a65ca1a71386f40080dd553756f3600d3b20d523 (commit)
       via  ed64b7f2b3cd920bb0f5dfd7f64ed0afc0b99fc1 (commit)
       via  a01244499dc3567f5aa934b1864b9bc183a6c242 (commit)
       via  a32298e7bc819694518e859f100f9444ff5663cd (commit)
       via  e6e56e5989def6704b116e806c1f261c7f3fc03f (commit)
       via  8362029c7cfc1041e46ee2116aa5cade6edce435 (commit)
       via  55370936ac5def5ebf138910388a2ddc2df9c20f (commit)
       via  a40faa2096effc2657ac05b729f3259bbb2e1fed (commit)
       via  c9a761726d141bcaa8ba7851150f71a8130b473a (commit)
       via  f50a12f6d06ed67efadd2a892d62c01e67310e7d (commit)
       via  12e07ccb4b57aca8b5b1b38ce711c7755c67f106 (commit)
       via  10e701fa9bba2a166c947a5a18f231ff64d9b861 (commit)
       via  53e6b9d1ba379ae27433871d1741c894cd71ccc1 (commit)
       via  a476a56da2219c1047081032595c045f65f8ad3f (commit)
       via  d75d7b49cf729bace820b3225e5c6d069bbcbc53 (commit)
      from  d148e7a7cb840febbdf56ba2e39c314cc2d7ac24 (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 974f849df0aca2cfedb38fa815894955e32803a8
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 2 15:09:13 2010 +1000

    Testing: IP allocation simulation - rename an example to node_group_extra.py.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 0a2a5602233a8208e2729192e50d816faed0151a
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 2 15:07:56 2010 +1000

    Testing: IP allocation simulation - rename an example to node_group_simple.py.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit d382d9023928f75f360a115ae1e9c1036423416e
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 2 15:06:39 2010 +1000

    Testing: IP allocation simulation - add general node group example.
    
    This allows node pool configuration to be specifed on the
    command-line.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit a65ca1a71386f40080dd553756f3600d3b20d523
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 2 15:01:47 2010 +1000

    Testing: IP allocation simulation - update options processing in examples.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit ed64b7f2b3cd920bb0f5dfd7f64ed0afc0b99fc1
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 2 14:58:15 2010 +1000

    Testing: IP allocation simulation - Update README.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit a01244499dc3567f5aa934b1864b9bc183a6c242
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 2 14:24:00 2010 +1000

    Testing: IP allocation simulation - fix nondeterminism in do_something_random().
    
    The current code makes random choices from unsorted lists.  This
    ensures the lists are sorted.
    
    Also, make the code easier to read by doing the random selction from
    lists of PNNs rather than lists of Node objects.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit a32298e7bc819694518e859f100f9444ff5663cd
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 2 14:20:12 2010 +1000

    Testing: IP allocation simulation - Tweak options handling and Cluster.diff().
    
    process_args() must now be called by programs inporting this module.
    Options are put into global variable "options", which can be
    references using "ctdb_takeover.options".
    
    Can now pass extra option specifications to process_args().
    
    Remove global variable prev and make it a Cluster object variable.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit e6e56e5989def6704b116e806c1f261c7f3fc03f
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 2 14:16:02 2010 +1000

    Testing: IP allocation simulation - update copyright message.
    
    There's a lot of new code here, so let's make the copyright message
    make sense.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 8362029c7cfc1041e46ee2116aa5cade6edce435
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Aug 1 11:53:28 2010 +1000

    Testing: IP allocation simulation - add command line option for random seed.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 55370936ac5def5ebf138910388a2ddc2df9c20f
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Aug 1 11:41:52 2010 +1000

    Testing: IP allocation simulation - save some warnings for verbose mode.
    
    We don't need to see warnings about unallocatable IPs unless we're in
    verbose mode.  Can node be run with -n (and without -v or -d) to see
    just the statistics.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit a40faa2096effc2657ac05b729f3259bbb2e1fed
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Aug 1 11:41:02 2010 +1000

    Testing: IP allocation simulation prints final imbalance in statistics.
    
    This is useful to know.  When things get unbalance they tend to stay
    that way.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit c9a761726d141bcaa8ba7851150f71a8130b473a
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Aug 1 11:39:30 2010 +1000

    Testing: In IP allocation simulation count total number of events.
    
    This starts at -1 because we always have to do the initial allocation.
    
    No longer print event number for each event by default, only when
    verbose is enabled.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit f50a12f6d06ed67efadd2a892d62c01e67310e7d
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Aug 1 11:37:35 2010 +1000

    Testing: Add imbalance information to IP allocation simulation.
    
    Implement the imbalance calculations.
    
    Also add command-line option to display imbalance for each step.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 12e07ccb4b57aca8b5b1b38ce711c7755c67f106
Merge: 10e701fa9bba2a166c947a5a18f231ff64d9b861 d148e7a7cb840febbdf56ba2e39c314cc2d7ac24
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Jul 31 20:34:45 2010 +1000

    Merge branch 'master' of git://git.samba.org/sahlberg/ctdb

commit 10e701fa9bba2a166c947a5a18f231ff64d9b861
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jul 30 16:45:36 2010 +1000

    Testing: Add Python IP allocation simulation.
    
    Includes simulation module and example scenarios.  This allows you to
    test and perhaps tweak an algorithm that should be the same as the
    current CTDB IP reallocation one.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 53e6b9d1ba379ae27433871d1741c894cd71ccc1
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jul 26 16:22:59 2010 +1000

    Optimise 61.nfstickle to write the tickles more efficiently.
    
    Currently the file for each IP address is reopened to append the
    details of each source socket.
    
    This optimisation puts all the logic into awk, including the matching
    of output lines from netstat.  The source sockets for each for each
    destination IP are written into an array entry and then each array
    entry is written to the corresponding file in a single operation.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit a476a56da2219c1047081032595c045f65f8ad3f
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jun 7 12:03:25 2010 +1000

    Test suite: handle extra lines in statistics output.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit d75d7b49cf729bace820b3225e5c6d069bbcbc53
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jun 7 12:29:31 2010 +1000

    Test suite: handle change to disconnected node error message.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

-----------------------------------------------------------------------

Summary of changes:
 tests/takeover/README                              |    3 +
 tests/takeover/ctdb_takeover.py                    |  132 ++++++++++++++------
 tests/takeover/mgmt_simple.py                      |    4 +-
 tests/takeover/node_group.py                       |   40 ++++++
 .../{node_pool_extra.py => node_group_extra.py}    |   10 +-
 .../{node_pool_simple.py => node_group_simple.py}  |    6 +-
 tests/takeover/node_pool_extra.py                  |    4 +-
 tests/takeover/node_pool_simple.py                 |    4 +-
 tests/takeover/nondet_path_01.py                   |    5 +-
 9 files changed, 157 insertions(+), 51 deletions(-)
 create mode 100755 tests/takeover/node_group.py
 copy tests/takeover/{node_pool_extra.py => node_group_extra.py} (64%)
 copy tests/takeover/{node_pool_simple.py => node_group_simple.py} (76%)


Changeset truncated at 500 lines:

diff --git a/tests/takeover/README b/tests/takeover/README
index 73815c7..4a8267b 100644
--- a/tests/takeover/README
+++ b/tests/takeover/README
@@ -1,3 +1,6 @@
 This contains a Python simulation of CTDB's IP reallocation algorithm.
 
 It is useful for experimenting with improvements.
+
+To use this on RHEL5 you'll need python2.6 from EPEL
+<http://fedoraproject.org/wiki/EPEL>.
diff --git a/tests/takeover/ctdb_takeover.py b/tests/takeover/ctdb_takeover.py
index 19608a3..c7341b9 100755
--- a/tests/takeover/ctdb_takeover.py
+++ b/tests/takeover/ctdb_takeover.py
@@ -2,10 +2,12 @@
 
 # ctdb ip takeover code
 
+# Copyright (C) Martin Schwenke 2010
+
+# Based on original CTDB C code:
+#
 # Copyright (C) Ronnie Sahlberg  2007
 # Copyright (C) Andrew Tridgell  2007
-#
-# Python version (C) Martin Schwenke 2010
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -23,14 +25,17 @@
 
 import os
 import sys
+# Use optparse since newer argparse not available in RHEL5/EPEL.
 from optparse import OptionParser
 import copy
 import random
 
-def process_args():
-    usage = "usage: %prog [options]"
+options = None
 
-    parser = OptionParser(usage=usage)
+def process_args(extra_options=[]):
+    global options
+
+    parser = OptionParser(option_list=extra_options)
 
     parser.add_option("--nd",
                       action="store_false", dest="deterministic_public_ips",
@@ -58,6 +63,16 @@ def process_args():
                       action="store", type="int", dest="iterations",
                       default=1000,
                       help="number of iterations to run in test")
+
+    def seed_callback(option, opt, value, parser):
+        random.seed(value)
+    parser.add_option("-s", "--seed",
+                      action="callback", type="int", callback=seed_callback,
+                      help="number of iterations to run in test")
+
+    parser.add_option("-b", "--balance",
+                      action="store_true", dest="balance", default=False,
+                      help="show (im)balance information")
     parser.add_option("-x", "--exit",
                       action="store_true", dest="exit", default=False,
                       help="exit on the 1st gratuitous IP move")
@@ -67,8 +82,6 @@ def process_args():
     if len(args) != 0:
         parser.error("too many argumentss")
 
-    return options
-
 def print_begin(t):
     print "=" * 40
     print "%s:" % (t)
@@ -106,8 +119,6 @@ class Node(object):
 
 class Cluster(object):
     def __init__(self):
-        global options
-
         self.nodes = []
         self.deterministic_public_ips = options.deterministic_public_ips
         self.no_ip_failback = options.no_ip_failback
@@ -116,6 +127,9 @@ class Cluster(object):
         self.ip_moves = []
         self.grat_ip_moves = []
         self.imbalance = []
+        self.events = -1
+
+        self.prev = None
 
     def __str__(self):
         return "\n".join(["%2d %s %s" %
@@ -127,9 +141,11 @@ class Cluster(object):
 
     def print_statistics(self):
         print_begin("STATISTICS")
+        print "Events:              %6d" % self.events
         print "Total IP moves:      %6d" % sum(self.ip_moves)
         print "Gratuitous IP moves: %6d" % sum(self.grat_ip_moves)
         print "Max imbalance:       %6d" % max(self.imbalance)
+        print "Final imbalance:     %6d" % self.imbalance[-1]
         print_end()
 
     def find_pnn_with_ip(self, ip):
@@ -149,8 +165,6 @@ class Cluster(object):
         self.all_public_ips |= node.public_addresses
 
     def healthy(self, *pnns):
-        global options
-
         verbose_begin("HEALTHY")
 
         for pnn in pnns:
@@ -179,23 +193,25 @@ class Cluster(object):
         unhealthy."""
 
         num_nodes = len(self.nodes)
-        healthy_nodes = [n for n in self.nodes if n.healthy]
-        num_healthy = len(healthy_nodes)
+        healthy_pnns = [i for (i,n) in enumerate(self.nodes) if n.healthy]
+        num_healthy = len(healthy_pnns)
 
         if num_nodes == num_healthy:
             self.unhealthy(random.randint(0, num_nodes-1))
         elif num_healthy == 0:
             self.healthy(random.randint(0, num_nodes-1))
         elif random.randint(1, 4) == 1:
-            self.unhealthy(self.nodes.index(random.choice(healthy_nodes)))
+            self.unhealthy(random.choice(healthy_pnns))
         else:
-            self.healthy(self.nodes.index(random.choice(list(set(self.nodes) - set(healthy_nodes)))))
+            all_pnns = range(num_nodes)
+            unhealthy_pnns = sorted(list(set(all_pnns) - set(healthy_pnns)))
+            self.healthy(random.choice(unhealthy_pnns))
 
     def random_iterations(self):
         i = 1
         while i <= options.iterations:
-            print_begin("EVENT %d" % i)
-            print_end()
+            verbose_begin("EVENT %d" % i)
+            verbose_end()
             self.do_something_random()
             if self.recover() and options.exit > 0:
                 break
@@ -203,8 +219,49 @@ class Cluster(object):
 
         self.print_statistics()
 
+    def calculate_imbalance(self):
+
+        imbalance = 0
+
+        assigned = sorted([ip
+                           for n in self.nodes
+                           for ip in n.current_addresses])
+
+        for ip in assigned:
+
+            num_capable = 0
+            maxnode = -1
+            minnode = -1
+            for (i, n) in enumerate(self.nodes):
+                if not n.healthy:
+                    continue
 
-    def diff(self, prev):
+                if not n.can_node_serve_ip(ip):
+                    continue
+
+                num_capable += 1
+
+                num = n.node_ip_coverage()
+
+                if maxnode == -1 or num > maxnum:
+                    maxnode = i
+                    maxnum = num
+
+                if minnode == -1 or num < minnum:
+                    minnode = i
+                    minnum = num
+            
+            if maxnode == -1:
+                continue
+
+            i = maxnum - minnum
+            if maxnum - minnum < 2:
+                i = 0
+            imbalance = max([imbalance, i])
+
+        return imbalance
+
+    def diff(self):
         """Calculate differences in IP assignments between self and prev.
 
         Gratuitous IP moves (from a healthy node to a healthy node)
@@ -214,19 +271,18 @@ class Cluster(object):
 
         ip_moves = 0
         grat_ip_moves = 0
-        imbalance = 0
         details = []
 
         for (new, n) in enumerate(self.nodes):
             for ip in n.current_addresses:
-                old = prev.find_pnn_with_ip(ip)
+                old = self.prev.find_pnn_with_ip(ip)
                 if old != new:
                     ip_moves += 1
                     if old != -1 and \
-                            prev.nodes[new].healthy and \
+                            self.prev.nodes[new].healthy and \
                             self.nodes[new].healthy and \
                             self.nodes[old].healthy and \
-                            prev.nodes[old].healthy:
+                            self.prev.nodes[old].healthy:
                         prefix = "!!"
                         grat_ip_moves += 1
                     else:
@@ -234,7 +290,7 @@ class Cluster(object):
                     details.append("%s %s: %d -> %d" %
                                    (prefix, ip, old, new))
 
-        return (ip_moves, grat_ip_moves, imbalance, details)
+        return (ip_moves, grat_ip_moves, details)
                     
     def find_least_loaded_node(self, ip):
         """Just like find_takeover_node but doesn't care about health."""
@@ -255,7 +311,7 @@ class Cluster(object):
                     min = num
 
         if pnn == -1:
-            print "Could not find node to take over public address", ip
+            verbose_print("Could not find node to take over public address %s" % ip)
             return False
 
         self.nodes[pnn].current_addresses.add(ip)
@@ -285,7 +341,7 @@ class Cluster(object):
                     min = num
 
         if pnn == -1:
-            print "Could not find node to take over public address", ip
+            verbose_print("Could not find node to take over public address %s" % ip)
             return False
 
         self.nodes[pnn].current_addresses.add(ip)
@@ -295,7 +351,7 @@ class Cluster(object):
 
     def ctdb_takeover_run(self):
 
-        global options
+        self.events += 1
 
         # Don't bother with the num_healthy stuff.  It is an
         # irrelevant detail.
@@ -402,8 +458,6 @@ class Cluster(object):
                     break
 
     def recover(self):
-        global options, prev
-
         verbose_begin("TAKEOVER")
 
         self.ctdb_takeover_run()
@@ -412,31 +466,29 @@ class Cluster(object):
 
         grat_ip_moves = 0
 
-        if prev is not None:
-            (ip_moves, grat_ip_moves, imbalance, details) = self.diff(prev)
+        if self.prev is not None:
+            (ip_moves, grat_ip_moves, details) = self.diff()
             self.ip_moves.append(ip_moves)
             self.grat_ip_moves.append(grat_ip_moves)
-            self.imbalance.append(imbalance)
 
             if options.diff:
                 print_begin("DIFF")
                 print "\n".join(details)
                 print_end()
 
+        imbalance = self.calculate_imbalance()
+        self.imbalance.append(imbalance)
+        if options.balance:
+            print_begin("IMBALANCE")
+            print imbalance
+            print_end()
 
         if options.show:
             print_begin("STATE")
             print self
             print_end()
 
-        prev = copy.deepcopy(self)
+        self.prev = None
+        self.prev = copy.deepcopy(self)
 
         return grat_ip_moves
-
-
-############################################################
-
-prev = None
-
-options = process_args()
-
diff --git a/tests/takeover/mgmt_simple.py b/tests/takeover/mgmt_simple.py
index bc5872f..f891199 100755
--- a/tests/takeover/mgmt_simple.py
+++ b/tests/takeover/mgmt_simple.py
@@ -4,7 +4,9 @@
 # interface node and a management node.  When run with deterministic
 # IPs there are gratuitous IP reassignments.
 
-from ctdb_takeover import Cluster, Node
+from ctdb_takeover import Cluster, Node, process_args
+
+process_args()
 
 addresses = ['A', 'B', 'C', 'D', 'E', 'F', 'G']
 
diff --git a/tests/takeover/node_group.py b/tests/takeover/node_group.py
new file mode 100755
index 0000000..b0a5648
--- /dev/null
+++ b/tests/takeover/node_group.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+
+# This demonstrates a node group configurations.
+#
+# Node groups can be defined with the syntax "-g N at IP0,IP1-IP2,IP3".
+# This says to create a group of N nodes with IPs IP0, IP1, ..., IP2,
+# IP3.  Run it with deterministic IPs causes lots of gratuitous IP
+# reassignments.  Running with --nd fixes this.
+
+import ctdb_takeover
+from optparse import make_option
+import string
+
+ctdb_takeover.process_args([
+        make_option("-g", "--group",
+                    action="append", type="string", dest="groups"),
+        ])
+
+def expand_range(r):
+    sr = r.split("-", 1)
+    if len(sr) == 2:
+        all = string.ascii_uppercase + string.ascii_lowercase
+        sr = list(all[all.index(sr[0]):all.index(sr[1])+1])
+    return sr
+            
+def add_node_group(s):
+    (count, ips_str) = s.split("@", 1)
+    ips = [i for r in ips_str.split(",") \
+               for i in expand_range(r) if r != ""]
+    for i in range(int(count)):
+        c.add_node(ctdb_takeover.Node(ips))
+
+c = ctdb_takeover.Cluster()
+
+for g in ctdb_takeover.options.groups:
+    add_node_group(g)
+
+c.recover()
+
+c.random_iterations()
diff --git a/tests/takeover/node_pool_extra.py b/tests/takeover/node_group_extra.py
similarity index 64%
copy from tests/takeover/node_pool_extra.py
copy to tests/takeover/node_group_extra.py
index dcac553..7e9e518 100755
--- a/tests/takeover/node_pool_extra.py
+++ b/tests/takeover/node_group_extra.py
@@ -1,13 +1,15 @@
 #!/usr/bin/env python
 
-# This example demonstrates a node pool configuration.  Is it meant to
-# be the same as node_pool_simple.py, but with a couple of nodes added
-# later, so they are listed after the management node.
+# This example demonstrates a node group configuration.  Is it meant
+# to be the same as node_group_simple.py, but with a couple of nodes
+# added later, so they are listed after the management node.
 
 # When run with deterministic IPs (use "-d" to show the problem) it
 # does many gratuitous IP reassignments.
 
-from ctdb_takeover import Cluster, Node
+from ctdb_takeover import Cluster, Node, process_args
+
+process_args()
 
 addresses1 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'] + ['P', 'Q', 'R', 'S', 'T', 'U']
 addresses2 = ['I', 'J', 'K', 'L']
diff --git a/tests/takeover/node_pool_simple.py b/tests/takeover/node_group_simple.py
similarity index 76%
copy from tests/takeover/node_pool_simple.py
copy to tests/takeover/node_group_simple.py
index 0acd004..3c58ef7 100755
--- a/tests/takeover/node_pool_simple.py
+++ b/tests/takeover/node_group_simple.py
@@ -1,10 +1,12 @@
 #!/usr/bin/env python
 
-# This example demonstrates a simple, sensible node pool
+# This example demonstrates a simple, sensible node group
 # configuration.  When run with deterministic IPs (use "-d" to show
 # the problem) it does many gratuitous IP reassignments.
 
-from ctdb_takeover import Cluster, Node
+from ctdb_takeover import Cluster, Node, process_args
+
+process_args()
 
 addresses1 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
 addresses2 = ['I', 'J', 'K']
diff --git a/tests/takeover/node_pool_extra.py b/tests/takeover/node_pool_extra.py
index dcac553..b4ae892 100755
--- a/tests/takeover/node_pool_extra.py
+++ b/tests/takeover/node_pool_extra.py
@@ -7,7 +7,9 @@
 # When run with deterministic IPs (use "-d" to show the problem) it
 # does many gratuitous IP reassignments.
 
-from ctdb_takeover import Cluster, Node
+from ctdb_takeover import Cluster, Node, process_args
+
+process_args()
 
 addresses1 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'] + ['P', 'Q', 'R', 'S', 'T', 'U']
 addresses2 = ['I', 'J', 'K', 'L']
diff --git a/tests/takeover/node_pool_simple.py b/tests/takeover/node_pool_simple.py
index 0acd004..86c5d10 100755
--- a/tests/takeover/node_pool_simple.py
+++ b/tests/takeover/node_pool_simple.py
@@ -4,7 +4,9 @@
 # configuration.  When run with deterministic IPs (use "-d" to show
 # the problem) it does many gratuitous IP reassignments.
 
-from ctdb_takeover import Cluster, Node
+from ctdb_takeover import Cluster, Node, process_args
+
+process_args()
 
 addresses1 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
 addresses2 = ['I', 'J', 'K']
diff --git a/tests/takeover/nondet_path_01.py b/tests/takeover/nondet_path_01.py
index b96fad3..a62847a 100755
--- a/tests/takeover/nondet_path_01.py
+++ b/tests/takeover/nondet_path_01.py
@@ -2,9 +2,10 @@
 
 # This is a contrived example that makes the balancing algorithm fail
 # for nondeterministic IPs (run with "-dv --nd" to see the failure).
-# The --hack option fixes the problem.
 
-from ctdb_takeover import Cluster, Node
+from ctdb_takeover import Cluster, Node, process_args
+
+process_args()
 
 addresses1 = ['A', 'B', 'C', 'D']
 addresses2 = ['B', 'E', 'F']


-- 
CTDB repository


More information about the samba-cvs mailing list