[SCM] Samba Shared Repository - branch master updated

Amitay Isaacs amitay at samba.org
Mon Dec 19 06:59:03 UTC 2016


The branch, master has been updated
       via  59dc07e ctdb-tests: Remove the python LCP2 simulation
       via  641b69d ctdb-takeover: Drop unused ctdb_takeover_run() and related code
       via  f2485d3 ctdb-recoverd: Integrate takeover helper
       via  5b60414 ctdb-recoverd: Generalise helper state, handler and launching
       via  89b4920 ctdb-tests: Add tests for takeover helper
       via  27cb5d6 ctdb-tests: New function unit_test_notrace()
       via  8d9b41d ctdb-takeover: Add takeover helper
       via  605347f ctdb-takeover: IPAllocAlgorithm replaces LCP2PublicIPs, DeterministicIPs
       via  3d80fdd ctdb-takeover: NoIPHostOnAllDisabled is global across cluster
       via  9b456bc ctdb-takeover: NoIPTakeover is global across cluster
       via  c4eab456 ctdb-docs: Document that tunables should be set the same on all nodes
       via  3fc3847 ctdb-tests: Add faking of control failures/timeouts to fake_ctdbd
       via  12de335 ctdb-tests: Add IPREALLOCATED control to fake_ctdbd
       via  421024a ctdb-tests: Add TAKEOVER_IP control to fake_ctdbd
       via  fc8ebad ctdb-tests: Add RELEASE_IP control to fake_ctdbd
       via  32266f0 ctdb-tests: Add tool tests for "ctdb ip"
       via  6f1419f ctdb-tests: Implement GET_PUBLIC_IPS control in fake_ctdbd
       via  6d97f39 ctdb-tests: Add tool tests for "ctdb ipinfo"
       via  f3e5709 ctdb-tests: Implement GET_PUBLIC_IP_INFO control in fake_ctdbd
       via  d421422 ctdb-tests: Factor out get_ctdb_iface_list()
       via  b993771 ctdb-tests: Add public IP state to fake_ctdbd
       via  16abc20 ctdb-tests: Factor out reading of known public IP addresses
       via  465323d ctdb-tests: Allow FAKE_CTDBD_DEBUGLEVEL to be specified
       via  b03b3f0 ctdb-tests: Make fake_ctdbd use logging_init()
       via  7d1b39c ctdb-client: Add available-only option public IP fetching
       via  4446581 ctdb-protocol: Move CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE to protocol.h
      from  fc28a74 ctdb-daemon: Remove ctdb_event_helper

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 59dc07ee4ab6350a2736a1bd47ba26be7fae67e2
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Dec 11 09:09:44 2016 +1100

    ctdb-tests: Remove the python LCP2 simulation
    
    It isn't used anywhere and doesn't contain some of the optimisations
    that have since gone into the C code.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Mon Dec 19 07:58:45 CET 2016 on sn-devel-144

commit 641b69da80f66e399c6ad78183067ccb4a76e02e
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Dec 9 19:19:49 2016 +1100

    ctdb-takeover: Drop unused ctdb_takeover_run() and related code
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit f2485d3ab9b51c63bf57185369e66131b391c7c0
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Dec 9 16:21:39 2016 +1100

    ctdb-recoverd: Integrate takeover helper
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 5b604142650c9e0735916a1d7edc3dcbc3f27889
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Dec 9 15:04:03 2016 +1100

    ctdb-recoverd: Generalise helper state, handler and launching
    
    These can also be used for takeover handler.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 89b49205391105c6ce2b058531c79d939fe97007
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Dec 7 09:42:46 2016 +1100

    ctdb-tests: Add tests for takeover helper
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 27cb5d63d548bcafbb0a41cbfd92b268f048f175
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Dec 14 07:18:57 2016 +1100

    ctdb-tests: New function unit_test_notrace()
    
    Avoids valgrind and such, so a function can be passed.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 8d9b41d42772e8d9fb56548f06f0602d926db6d2
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Nov 10 16:47:38 2016 +1100

    ctdb-takeover: Add takeover helper
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 605347faf6fc8f05f945b38a0d351efe378a18d2
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Dec 15 14:09:16 2016 +1100

    ctdb-takeover: IPAllocAlgorithm replaces LCP2PublicIPs, DeterministicIPs
    
    Introduce a single new tunable IPAllocAlgorithm to set the IP
    allocation algorithm.  This defaults to 2 for LCP2 IP address
    allocation.
    
    Tunables LCP2PublicIPs and DeterministicIPs are obsolete.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 3d80fdd5801c9bc8e81e0bc6fd3cb4f1bd355553
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Dec 10 20:03:38 2016 +1100

    ctdb-takeover: NoIPHostOnAllDisabled is global across cluster
    
    Instead of gathering the value from all nodes, just use the value on
    the recovery master and have it affect all nodes.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 9b456bc7301927d515bab14ae7b875330da70f21
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Dec 10 19:39:11 2016 +1100

    ctdb-takeover: NoIPTakeover is global across cluster
    
    Instead of gathering the value from all nodes, just use the value on
    the recovery master and have it affect all nodes.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit c4eab456ab9f634cd7fa0ce36749432d36d03a2b
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Dec 10 14:50:21 2016 +1100

    ctdb-docs: Document that tunables should be set the same on all nodes
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 3fc38472c6cf03546ad0a757a457279bd9f46282
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Dec 7 11:52:30 2016 +1100

    ctdb-tests: Add faking of control failures/timeouts to fake_ctdbd
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 12de3352d7d3de82c6ba3a23a00ba8b056f0542e
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Dec 5 19:11:13 2016 +1100

    ctdb-tests: Add IPREALLOCATED control to fake_ctdbd
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 421024a270e673ff9416892190217b188d31c998
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Dec 5 12:58:08 2016 +1100

    ctdb-tests: Add TAKEOVER_IP control to fake_ctdbd
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit fc8ebaddf42af245d82f6df441257c574b01652a
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Dec 5 12:53:53 2016 +1100

    ctdb-tests: Add RELEASE_IP control to fake_ctdbd
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 32266f09dd641de442232455e203ff7611fa1c41
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Dec 4 01:04:39 2016 +1100

    ctdb-tests: Add tool tests for "ctdb ip"
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 6f1419f72a617516f7c198908e85eedcb37e3f72
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Dec 4 01:01:48 2016 +1100

    ctdb-tests: Implement GET_PUBLIC_IPS control in fake_ctdbd
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 6d97f393540660eac3a663c1b5fa54a941e226de
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Dec 5 11:08:39 2016 +1100

    ctdb-tests: Add tool tests for "ctdb ipinfo"
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit f3e570952f9af8ce4f1ebef4d08a9945aeb9de59
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Dec 4 01:02:24 2016 +1100

    ctdb-tests: Implement GET_PUBLIC_IP_INFO control in fake_ctdbd
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit d42142246c4fcfc921815c6110eb98646ed75453
Author: Martin Schwenke <martin at meltin.net>
Date:   Sun Dec 4 00:59:29 2016 +1100

    ctdb-tests: Factor out get_ctdb_iface_list()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit b993771ab0c18802926ebf272fdcf23126532d76
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Dec 3 17:11:25 2016 +1100

    ctdb-tests: Add public IP state to fake_ctdbd
    
    Read it via a PUBLICIPS section.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 16abc2071bea87eabb743d52ec273aa976da1f00
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Dec 3 16:20:01 2016 +1100

    ctdb-tests: Factor out reading of known public IP addresses
    
    One change in behaviour is to actually copy the known IPs per node
    instead of just assigning the pointer.  When this is used by
    fake_ctdbd the resulting structure will be used to keep state for
    individual nodes, so data for nodes needs to be independent.
    
    Also, drop some asserts in the factored code and do (slightly) better
    error handling.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 465323d14f553092f598cc49cdca7991980725de
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Dec 8 11:41:31 2016 +1100

    ctdb-tests: Allow FAKE_CTDBD_DEBUGLEVEL to be specified
    
    This is useful for debugging when doing developer testing.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit b03b3f0a3dc11738025afd5cde0ce7dd2fd75273
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Dec 12 16:43:43 2016 +1100

    ctdb-tests: Make fake_ctdbd use logging_init()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 7d1b39cf805d54166d16a61d6313a885b5929f7f
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Nov 10 16:11:12 2016 +1100

    ctdb-client: Add available-only option public IP fetching
    
    Update tool accordingly.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 44465817dd2d940d08e9c05f257c5032d8add816
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Nov 10 16:09:24 2016 +1100

    ctdb-protocol: Move CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE to protocol.h
    
    The protocol code needs it.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

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

Summary of changes:
 ctdb/client/client.h                               |    1 +
 ctdb/client/client_control_sync.c                  |    3 +-
 ctdb/common/tunable.c                              |    6 +-
 ctdb/doc/ctdb-tunables.7.xml                       |  118 +-
 ctdb/doc/ctdb.1.xml                                |    8 +-
 ctdb/include/ctdb_private.h                        |    3 -
 ctdb/include/ctdb_protocol.h                       |    2 -
 ctdb/packaging/RPM/ctdb.spec.in                    |    1 +
 ctdb/protocol/protocol.h                           |    3 +
 ctdb/protocol/protocol_api.h                       |    3 +-
 ctdb/protocol/protocol_client.c                    |    6 +-
 ctdb/server/ctdb_recoverd.c                        |  258 +++--
 ctdb/server/ctdb_takeover.c                        |  578 ----------
 ctdb/server/ctdb_takeover_helper.c                 | 1206 ++++++++++++++++++++
 ctdb/server/ipalloc.c                              |   45 +-
 ctdb/server/ipalloc.h                              |    6 +-
 ctdb/server/ipalloc_common.c                       |    2 +-
 ctdb/server/ipalloc_deterministic.c                |    3 +-
 ctdb/server/ipalloc_private.h                      |    3 +-
 ctdb/tests/run_tests.sh                            |    3 +-
 ctdb/tests/scripts/unit.sh                         |   10 +
 ctdb/tests/simple/04_ctdb_setvar.sh                |    4 +-
 ctdb/tests/simple/23_ctdb_moveip.sh                |    7 +-
 ctdb/tests/simple/73_tunable_NoIPTakeover.sh       |    4 +-
 ctdb/tests/simple/scripts/local_daemons.bash       |    1 +
 ctdb/tests/src/ctdb_takeover_tests.c               |  143 +--
 ctdb/tests/src/fake_ctdbd.c                        |  502 +++++++-
 ctdb/tests/src/ipalloc_read_known_ips.c            |  181 +++
 ctdb/tests/src/ipalloc_read_known_ips.h            |   32 +
 ctdb/tests/takeover/lcp2.012.sh                    |   12 +-
 ctdb/tests/takeover/lcp2.013.sh                    |    4 +-
 ctdb/tests/takeover/lcp2.020.sh                    |   33 -
 ctdb/tests/takeover/lcp2.021.sh                    |   33 -
 ctdb/tests/takeover/lcp2.022.sh                    |   17 +-
 ctdb/tests/takeover/simulation/README              |    6 -
 ctdb/tests/takeover/simulation/ctdb_takeover.py    |  888 --------------
 ctdb/tests/takeover/simulation/hey_jude.py         |   24 -
 ctdb/tests/takeover/simulation/ip_groups1.py       |   25 -
 ctdb/tests/takeover/simulation/ip_groups2.py       |   20 -
 ctdb/tests/takeover/simulation/ip_groups3.py       |   27 -
 ctdb/tests/takeover/simulation/ip_groups4.py       |   25 -
 ctdb/tests/takeover/simulation/ip_groups5.py       |   23 -
 ctdb/tests/takeover/simulation/mgmt_simple.py      |   22 -
 ctdb/tests/takeover/simulation/node_group.py       |   46 -
 ctdb/tests/takeover/simulation/node_group_extra.py |   31 -
 .../tests/takeover/simulation/node_group_simple.py |   26 -
 ctdb/tests/takeover/simulation/nondet_path_01.py   |   25 -
 ctdb/tests/takeover_helper/000.sh                  |   22 +
 ctdb/tests/takeover_helper/010.sh                  |   33 +
 ctdb/tests/takeover_helper/011.sh                  |   33 +
 ctdb/tests/takeover_helper/012.sh                  |   33 +
 ctdb/tests/takeover_helper/013.sh                  |   33 +
 ctdb/tests/takeover_helper/014.sh                  |   33 +
 ctdb/tests/takeover_helper/015.sh                  |   39 +
 ctdb/tests/takeover_helper/016.sh                  |   36 +
 ctdb/tests/takeover_helper/017.sh                  |   36 +
 ctdb/tests/takeover_helper/018.sh                  |   34 +
 ctdb/tests/takeover_helper/019.sh                  |   37 +
 ctdb/tests/takeover_helper/020.sh                  |   36 +
 ctdb/tests/takeover_helper/021.sh                  |   39 +
 ctdb/tests/takeover_helper/022.sh                  |   40 +
 ctdb/tests/takeover_helper/023.sh                  |   41 +
 ctdb/tests/takeover_helper/024.sh                  |   43 +
 ctdb/tests/takeover_helper/025.sh                  |   37 +
 ctdb/tests/takeover_helper/026.sh                  |   41 +
 ctdb/tests/takeover_helper/110.sh                  |   29 +
 ctdb/tests/takeover_helper/111.sh                  |   40 +
 ctdb/tests/takeover_helper/120.sh                  |   40 +
 ctdb/tests/takeover_helper/121.sh                  |   40 +
 ctdb/tests/takeover_helper/122.sh                  |   40 +
 ctdb/tests/takeover_helper/130.sh                  |   41 +
 ctdb/tests/takeover_helper/131.sh                  |   40 +
 ctdb/tests/takeover_helper/132.sh                  |   42 +
 ctdb/tests/takeover_helper/140.sh                  |   32 +
 ctdb/tests/takeover_helper/150.sh                  |   31 +
 ctdb/tests/takeover_helper/160.sh                  |   31 +
 ctdb/tests/takeover_helper/210.sh                  |   29 +
 ctdb/tests/takeover_helper/211.sh                  |   40 +
 ctdb/tests/takeover_helper/220.sh                  |   40 +
 ctdb/tests/takeover_helper/230.sh                  |   41 +
 ctdb/tests/takeover_helper/240.sh                  |   32 +
 ctdb/tests/takeover_helper/250.sh                  |   31 +
 ctdb/tests/takeover_helper/260.sh                  |   31 +
 ctdb/tests/takeover_helper/scripts/local.sh        |  109 ++
 ctdb/tests/tool/ctdb.ip.001.sh                     |   17 +
 ctdb/tests/tool/ctdb.ip.002.sh                     |   17 +
 ctdb/tests/tool/ctdb.ip.003.sh                     |   30 +
 ctdb/tests/tool/ctdb.ip.004.sh                     |   29 +
 ctdb/tests/tool/ctdb.ip.005.sh                     |   30 +
 ctdb/tests/tool/ctdb.ip.006.sh                     |   30 +
 ctdb/tests/tool/ctdb.ip.007.sh                     |   36 +
 ctdb/tests/tool/ctdb.ipinfo.001.sh                 |   18 +
 ctdb/tests/tool/ctdb.ipinfo.002.sh                 |   32 +
 ctdb/tests/tool/ctdb.ipinfo.003.sh                 |   35 +
 ctdb/tests/tool/ctdb.listvars.001.sh               |    3 +-
 ctdb/tests/tool/scripts/local.sh                   |    7 +-
 ctdb/tools/ctdb.c                                  |   14 +-
 ctdb/wscript                                       |   13 +-
 98 files changed, 3944 insertions(+), 2201 deletions(-)
 create mode 100644 ctdb/server/ctdb_takeover_helper.c
 create mode 100644 ctdb/tests/src/ipalloc_read_known_ips.c
 create mode 100644 ctdb/tests/src/ipalloc_read_known_ips.h
 delete mode 100755 ctdb/tests/takeover/lcp2.020.sh
 delete mode 100755 ctdb/tests/takeover/lcp2.021.sh
 delete mode 100644 ctdb/tests/takeover/simulation/README
 delete mode 100755 ctdb/tests/takeover/simulation/ctdb_takeover.py
 delete mode 100755 ctdb/tests/takeover/simulation/hey_jude.py
 delete mode 100755 ctdb/tests/takeover/simulation/ip_groups1.py
 delete mode 100755 ctdb/tests/takeover/simulation/ip_groups2.py
 delete mode 100755 ctdb/tests/takeover/simulation/ip_groups3.py
 delete mode 100755 ctdb/tests/takeover/simulation/ip_groups4.py
 delete mode 100755 ctdb/tests/takeover/simulation/ip_groups5.py
 delete mode 100755 ctdb/tests/takeover/simulation/mgmt_simple.py
 delete mode 100755 ctdb/tests/takeover/simulation/node_group.py
 delete mode 100755 ctdb/tests/takeover/simulation/node_group_extra.py
 delete mode 100755 ctdb/tests/takeover/simulation/node_group_simple.py
 delete mode 100755 ctdb/tests/takeover/simulation/nondet_path_01.py
 create mode 100755 ctdb/tests/takeover_helper/000.sh
 create mode 100755 ctdb/tests/takeover_helper/010.sh
 create mode 100755 ctdb/tests/takeover_helper/011.sh
 create mode 100755 ctdb/tests/takeover_helper/012.sh
 create mode 100755 ctdb/tests/takeover_helper/013.sh
 create mode 100755 ctdb/tests/takeover_helper/014.sh
 create mode 100755 ctdb/tests/takeover_helper/015.sh
 create mode 100755 ctdb/tests/takeover_helper/016.sh
 create mode 100755 ctdb/tests/takeover_helper/017.sh
 create mode 100755 ctdb/tests/takeover_helper/018.sh
 create mode 100755 ctdb/tests/takeover_helper/019.sh
 create mode 100755 ctdb/tests/takeover_helper/020.sh
 create mode 100755 ctdb/tests/takeover_helper/021.sh
 create mode 100755 ctdb/tests/takeover_helper/022.sh
 create mode 100755 ctdb/tests/takeover_helper/023.sh
 create mode 100755 ctdb/tests/takeover_helper/024.sh
 create mode 100755 ctdb/tests/takeover_helper/025.sh
 create mode 100755 ctdb/tests/takeover_helper/026.sh
 create mode 100755 ctdb/tests/takeover_helper/110.sh
 create mode 100755 ctdb/tests/takeover_helper/111.sh
 create mode 100755 ctdb/tests/takeover_helper/120.sh
 create mode 100755 ctdb/tests/takeover_helper/121.sh
 create mode 100755 ctdb/tests/takeover_helper/122.sh
 create mode 100755 ctdb/tests/takeover_helper/130.sh
 create mode 100755 ctdb/tests/takeover_helper/131.sh
 create mode 100755 ctdb/tests/takeover_helper/132.sh
 create mode 100755 ctdb/tests/takeover_helper/140.sh
 create mode 100755 ctdb/tests/takeover_helper/150.sh
 create mode 100755 ctdb/tests/takeover_helper/160.sh
 create mode 100755 ctdb/tests/takeover_helper/210.sh
 create mode 100755 ctdb/tests/takeover_helper/211.sh
 create mode 100755 ctdb/tests/takeover_helper/220.sh
 create mode 100755 ctdb/tests/takeover_helper/230.sh
 create mode 100755 ctdb/tests/takeover_helper/240.sh
 create mode 100755 ctdb/tests/takeover_helper/250.sh
 create mode 100755 ctdb/tests/takeover_helper/260.sh
 create mode 100644 ctdb/tests/takeover_helper/scripts/local.sh
 create mode 100755 ctdb/tests/tool/ctdb.ip.001.sh
 create mode 100755 ctdb/tests/tool/ctdb.ip.002.sh
 create mode 100755 ctdb/tests/tool/ctdb.ip.003.sh
 create mode 100755 ctdb/tests/tool/ctdb.ip.004.sh
 create mode 100755 ctdb/tests/tool/ctdb.ip.005.sh
 create mode 100755 ctdb/tests/tool/ctdb.ip.006.sh
 create mode 100755 ctdb/tests/tool/ctdb.ip.007.sh
 create mode 100755 ctdb/tests/tool/ctdb.ipinfo.001.sh
 create mode 100755 ctdb/tests/tool/ctdb.ipinfo.002.sh
 create mode 100755 ctdb/tests/tool/ctdb.ipinfo.003.sh


Changeset truncated at 500 lines:

diff --git a/ctdb/client/client.h b/ctdb/client/client.h
index f6d3fd3..312615e 100644
--- a/ctdb/client/client.h
+++ b/ctdb/client/client.h
@@ -470,6 +470,7 @@ int ctdb_ctrl_takeover_ip(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 int ctdb_ctrl_get_public_ips(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 			     struct ctdb_client_context *client,
 			     int destnode, struct timeval timeout,
+			     bool available_only,
 			     struct ctdb_public_ip_list **pubip_list);
 
 int ctdb_ctrl_get_nodemap(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
diff --git a/ctdb/client/client_control_sync.c b/ctdb/client/client_control_sync.c
index d59767b..5d4e52a 100644
--- a/ctdb/client/client_control_sync.c
+++ b/ctdb/client/client_control_sync.c
@@ -1527,13 +1527,14 @@ int ctdb_ctrl_takeover_ip(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 int ctdb_ctrl_get_public_ips(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
 			     struct ctdb_client_context *client,
 			     int destnode, struct timeval timeout,
+			     bool available_only,
 			     struct ctdb_public_ip_list **pubip_list)
 {
 	struct ctdb_req_control request;
 	struct ctdb_reply_control *reply;
 	int ret;
 
-	ctdb_req_control_get_public_ips(&request);
+	ctdb_req_control_get_public_ips(&request, available_only);
 	ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
 				  &request, &reply);
 	if (ret != 0) {
diff --git a/ctdb/common/tunable.c b/ctdb/common/tunable.c
index 5f36088..5b640d9 100644
--- a/ctdb/common/tunable.c
+++ b/ctdb/common/tunable.c
@@ -75,9 +75,9 @@ static struct {
 		offsetof(struct ctdb_tunable_list, rerecovery_timeout) },
 	{ "EnableBans", 1, false,
 		offsetof(struct ctdb_tunable_list, enable_bans) },
-	{ "DeterministicIPs", 0, false,
+	{ "DeterministicIPs", 0, true,
 		offsetof(struct ctdb_tunable_list, deterministic_public_ips) },
-	{ "LCP2PublicIPs", 1, false,
+	{ "LCP2PublicIPs", 1, true,
 		offsetof(struct ctdb_tunable_list, lcp2_public_ip_assignment) },
 	{ "ReclockPingPeriod", 60, true,
 		offsetof(struct ctdb_tunable_list,  reclock_ping_period) },
@@ -153,6 +153,8 @@ static struct {
 		offsetof(struct ctdb_tunable_list, rec_buffer_size_limit) },
 	{ "QueueBufferSize", 1024, false,
 		offsetof(struct ctdb_tunable_list, queue_buffer_size) },
+	{ "IPAllocAlgorithm", 2, false,
+		offsetof(struct ctdb_tunable_list, ip_alloc_algorithm) },
 	{ NULL, 0, true, }
 };
 
diff --git a/ctdb/doc/ctdb-tunables.7.xml b/ctdb/doc/ctdb-tunables.7.xml
index 8143a45..8a789a5 100644
--- a/ctdb/doc/ctdb-tunables.7.xml
+++ b/ctdb/doc/ctdb-tunables.7.xml
@@ -30,6 +30,14 @@
     </para>
 
     <para>
+      Unless otherwise stated, tunables should be set to the same
+      value on all nodes.  Setting tunables to different values across
+      nodes may produce unexpected results.  Future releases may set
+      (some or most) tunables globally across the cluster but doing so
+      is currently a manual process.
+    </para>
+
+    <para>
       The tunable variables are listed alphabetically.
     </para>
 
@@ -128,24 +136,6 @@
     </refsect2>
 
     <refsect2>
-      <title>DeterministicIPs</title>
-      <para>Default: 0</para>
-      <para>
-	When set to 1, ctdb will try to keep public IP addresses locked
-	to specific nodes as far as possible. This makes it easier
-	for debugging since you can know that as long as all nodes are
-	healthy public IP X will always be hosted by node Y.
-      </para>
-      <para>
-	The cost of using deterministic IP address assignment is that it
-	disables part of the logic where ctdb tries to reduce the number
-	of public IP assignment changes in the cluster. This tunable may
-	increase the number of IP failover/failbacks that are performed
-	on the cluster by a small margin.
-      </para>
-    </refsect2>
-
-    <refsect2>
       <title>DisableIPFailover</title>
       <para>Default: 0</para>
       <para>
@@ -177,13 +167,12 @@
       <title>EnableBans</title>
       <para>Default: 1</para>
       <para>
-        This parameter allows ctdb to ban a node if the node is misbehaving.
+	This parameter allows ctdb to ban a node if the node is misbehaving.
       </para>
       <para>
 	When set to 0, this disables banning completely in the cluster
 	and thus nodes can not get banned, even it they break. Don't
-	set to 0 unless you know what you are doing.  You should set
-	this to the same value on all nodes to avoid unexpected behaviour.
+	set to 0 unless you know what you are doing.
       </para>
     </refsect2>
 
@@ -243,6 +232,70 @@
     </refsect2>
 
     <refsect2>
+      <title>IPAllocAlgorithm</title>
+      <para>Default: 2</para>
+      <para>
+	Selects the algorithm that CTDB should use when doing public
+	IP address allocation.  Meaningful values are:
+      </para>
+      <variablelist>
+	<varlistentry>
+	  <term>0</term>
+	  <listitem>
+	    <para>
+	      Deterministic IP address allocation.
+	    </para>
+	    <para>
+	      This is a simple and fast option.  However, it can cause
+	      unnecessary address movement during fail-over because
+	      each address has a "home" node.  Works badly when some
+	      nodes do not have any addresses defined.  Should be used
+	      with care when addresses are defined across multiple
+	      networks.
+	    </para>
+	  </listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term>1</term>
+	  <listitem>
+	    <para>
+	      Non-deterministic IP address allocation.
+	    </para>
+	    <para>
+	      This is a relatively fast option that attempts to do a
+	      minimise unnecessary address movements.  Addresses do
+	      not have a "home" node.  Rebalancing is limited but it
+	      usually adequate.  Works badly when addresses are
+	      defined across multiple networks.
+	    </para>
+	  </listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term>2</term>
+	  <listitem>
+	    <para>
+	      LCP2 IP address allocation.
+	    </para>
+	    <para>
+	      Uses a heuristic to assign addresses defined across
+	      multiple networks, usually balancing addresses on each
+	      network evenly across nodes.  Addresses do not have a
+	      "home" node.  Minimises unnecessary address movements.
+	      The algorithm is complex, so is slower than other
+	      choices for a large number of addresses.  However, it
+	      can calculate an optimal assignment of 900 addresses in
+	      under 10 seconds on modern hardware.
+	    </para>
+	  </listitem>
+	</varlistentry>
+      </variablelist>
+      <para>
+	If the specified value is not one of these then the default
+	will be used.
+      </para>
+    </refsect2>
+
+    <refsect2>
       <title>KeepaliveInterval</title>
       <para>Default: 5</para>
       <para>
@@ -270,14 +323,6 @@
     </refsect2>
 
     <refsect2>
-      <title>LCP2PublicIPs</title>
-      <para>Default: 1</para>
-      <para>
-	When set to 1, ctdb uses the LCP2 ip allocation algorithm.
-      </para>
-    </refsect2>
-
-    <refsect2>
       <title>LockProcessesPerDB</title>
       <para>Default: 200</para>
       <para>
@@ -362,10 +407,9 @@
 	If no nodes are HEALTHY then by default ctdb will happily host
 	public IPs on disabled (unhealthy or administratively disabled)
 	nodes.	This can cause problems, for example if the underlying
-	cluster filesystem is not mounted.  When set to 1 on a node and
-	that node is disabled, any IPs hosted by this node will be
-	released and the node will not takeover any IPs until it is no
-	longer disabled.
+	cluster filesystem is not mounted.  When set to 1 and a node
+	is disabled, any IPs hosted by this node will be released and
+	the node will not takeover any IPs until it is no longer disabled.
       </para>
     </refsect2>
 
@@ -374,9 +418,11 @@
       <para>Default: 0</para>
       <para>
 	When set to 1, ctdb will not allow IP addresses to be failed
-	over onto this node. Any IP addresses that the node currently
-	hosts will remain on the node but no new IP addresses can be
-	failed over to the node.
+	over to other nodes.  Any IP addresses already hosted on
+	healthy nodes will remain.  Usually IP addresses hosted on
+	unhealthy nodes will also remain, if NoIPHostOnAllDisabled is
+	0.  However, if NoIPHostOnAllDisabled is 1 then IP addresses
+	will be released by unhealthy nodes and will become un-hosted.
       </para>
     </refsect2>
 
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 2f371c0..1d6979a 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -813,8 +813,6 @@ DatabaseHashSize        = 100001
 DatabaseMaxDead         = 5
 RerecoveryTimeout       = 10
 EnableBans              = 1
-DeterministicIPs        = 0
-LCP2PublicIPs           = 1
 NoIPFailback            = 0
 DisableIPFailover       = 0
 VerboseMemoryNames      = 0
@@ -845,9 +843,11 @@ DBRecordSizeWarn        = 10000000
 DBSizeWarn              = 100000000
 PullDBPreallocation     = 10485760
 NoIPHostOnAllDisabled   = 0
-Samba3AvoidDeadlocks    = 0
 TDBMutexEnabled         = 0
 LockProcessesPerDB      = 200
+RecBufferSizeLimit      = 1000000
+QueueBufferSize         = 1024
+IPAllocAlgorithm        = 2
 	</screen>
       </refsect3>
     </refsect2>
@@ -1201,7 +1201,7 @@ DB Statistics: locking.tdb
 	when you have changed the tunables for the daemon to:
       </para>
       <para>
-	DeterministicIPs = 0
+	IPAllocAlgorithm != 0
       </para>
       <para>
 	NoIPFailback = 1
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 9716c7c..d81ed56 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -887,9 +887,6 @@ int32_t ctdb_control_ipreallocated(struct ctdb_context *ctdb,
 
 int ctdb_set_public_addresses(struct ctdb_context *ctdb, bool check_addresses);
 
-int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap,
-		      uint32_t *force_rebalance_nodes);
-
 int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
 				TDB_DATA indata);
 int32_t ctdb_control_tcp_add(struct ctdb_context *ctdb, TDB_DATA indata,
diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h
index 2b2fd76..2fb3b6d 100644
--- a/ctdb/include/ctdb_protocol.h
+++ b/ctdb/include/ctdb_protocol.h
@@ -266,8 +266,6 @@ struct ctdb_control_list_tunable {
 };
 
 
-#define CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE 0x00010000
-
 struct ctdb_public_ip_info_old {
 	struct ctdb_public_ip ip;
 	uint32_t active_idx;
diff --git a/ctdb/packaging/RPM/ctdb.spec.in b/ctdb/packaging/RPM/ctdb.spec.in
index d6e5128..41573d2 100644
--- a/ctdb/packaging/RPM/ctdb.spec.in
+++ b/ctdb/packaging/RPM/ctdb.spec.in
@@ -216,6 +216,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_libexecdir}/ctdb/ctdb_eventd
 %{_libexecdir}/ctdb/ctdb_lock_helper
 %{_libexecdir}/ctdb/ctdb_recovery_helper
+%{_libexecdir}/ctdb/ctdb_takeover_helper
 %{_libexecdir}/ctdb/ctdb_mutex_fcntl_helper
 %{_libexecdir}/ctdb/ctdb_event
 %{_libexecdir}/ctdb/ctdb_natgw
diff --git a/ctdb/protocol/protocol.h b/ctdb/protocol/protocol.h
index f61af3b..7b5a598 100644
--- a/ctdb/protocol/protocol.h
+++ b/ctdb/protocol/protocol.h
@@ -631,6 +631,7 @@ struct ctdb_tunable_list {
 	uint32_t lock_processes_per_db;
 	uint32_t rec_buffer_size_limit;
 	uint32_t queue_buffer_size;
+	uint32_t ip_alloc_algorithm;
 };
 
 struct ctdb_tickle_list {
@@ -913,6 +914,8 @@ struct ctdb_req_control {
 	uint32_t client_id;
 #define CTDB_CTRL_FLAG_NOREPLY   1
 #define CTDB_CTRL_FLAG_OPCODE_SPECIFIC   0xFFFF0000
+/* Ugly overloading of this field... */
+#define CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE 0x00010000
 	uint32_t flags;
 	struct ctdb_req_control_data rdata;
 };
diff --git a/ctdb/protocol/protocol_api.h b/ctdb/protocol/protocol_api.h
index 1a1b83a..dfb75d4 100644
--- a/ctdb/protocol/protocol_api.h
+++ b/ctdb/protocol/protocol_api.h
@@ -412,7 +412,8 @@ void ctdb_req_control_takeover_ip(struct ctdb_req_control *request,
 				  struct ctdb_public_ip *pubip);
 int ctdb_reply_control_takeover_ip(struct ctdb_reply_control *reply);
 
-void ctdb_req_control_get_public_ips(struct ctdb_req_control *request);
+void ctdb_req_control_get_public_ips(struct ctdb_req_control *request,
+				     bool available_only);
 int ctdb_reply_control_get_public_ips(struct ctdb_reply_control *reply,
 				      TALLOC_CTX *mem_ctx,
 				      struct ctdb_public_ip_list **pubip_list);
diff --git a/ctdb/protocol/protocol_client.c b/ctdb/protocol/protocol_client.c
index 63ccdab..fe65a8a 100644
--- a/ctdb/protocol/protocol_client.c
+++ b/ctdb/protocol/protocol_client.c
@@ -1358,7 +1358,8 @@ int ctdb_reply_control_takeover_ip(struct ctdb_reply_control *reply)
 
 /* CTDB_CONTROL_GET_PUBLIC_IPS */
 
-void ctdb_req_control_get_public_ips(struct ctdb_req_control *request)
+void ctdb_req_control_get_public_ips(struct ctdb_req_control *request,
+				     bool available_only)
 {
 	request->opcode = CTDB_CONTROL_GET_PUBLIC_IPS;
 	request->pad = 0;
@@ -1367,6 +1368,9 @@ void ctdb_req_control_get_public_ips(struct ctdb_req_control *request)
 	request->flags = 0;
 
 	request->rdata.opcode = CTDB_CONTROL_GET_PUBLIC_IPS;
+	if (available_only) {
+		request->flags = CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE;
+	}
 }
 
 int ctdb_reply_control_get_public_ips(struct ctdb_reply_control *reply,
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 1e04960..9ea0f61 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -995,6 +995,153 @@ static void ban_misbehaving_nodes(struct ctdb_recoverd *rec, bool *self_ban)
 	}
 }
 
+struct helper_state {
+	int fd[2];
+	pid_t pid;
+	int result;
+	bool done;
+};
+
+static void helper_handler(struct tevent_context *ev,
+			   struct tevent_fd *fde,
+			   uint16_t flags, void *private_data)
+{
+	struct helper_state *state = talloc_get_type_abort(
+		private_data, struct helper_state);
+	int ret;
+
+	ret = sys_read(state->fd[0], &state->result, sizeof(state->result));
+	if (ret != sizeof(state->result)) {
+		state->result = EPIPE;
+	}
+
+	state->done = true;
+}
+
+static int helper_run(struct ctdb_recoverd *rec, TALLOC_CTX *mem_ctx,
+		      const char *prog, const char *arg, const char *type)
+{
+	struct helper_state *state;
+	struct tevent_fd *fde;
+	const char **args;
+	int nargs, ret;
+
+	state = talloc_zero(mem_ctx, struct helper_state);
+	if (state == NULL) {
+		DEBUG(DEBUG_ERR, (__location__ " memory error\n"));
+		return -1;
+	}
+
+	state->pid = -1;
+
+	ret = pipe(state->fd);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR,
+		      ("Failed to create pipe for %s helper\n", type));
+		goto fail;
+	}
+
+	set_close_on_exec(state->fd[0]);
+
+	nargs = 4;
+	args = talloc_array(state, const char *, nargs);
+	if (args == NULL) {
+		DEBUG(DEBUG_ERR, (__location__ " memory error\n"));
+		goto fail;
+	}
+
+	args[0] = talloc_asprintf(args, "%d", state->fd[1]);
+	if (args[0] == NULL) {
+		DEBUG(DEBUG_ERR, (__location__ " memory error\n"));
+		goto fail;
+	}
+	args[1] = rec->ctdb->daemon.name;
+	args[2] = arg;
+	args[3] = NULL;
+
+	if (args[2] == NULL) {
+		nargs = 3;
+	}
+
+	state->pid = ctdb_vfork_exec(state, rec->ctdb, prog, nargs, args);
+	if (state->pid == -1) {
+		DEBUG(DEBUG_ERR,
+		      ("Failed to create child for %s helper\n", type));
+		goto fail;
+	}
+
+	close(state->fd[1]);
+	state->fd[1] = -1;
+
+	state->done = false;
+
+	fde = tevent_add_fd(rec->ctdb->ev, rec->ctdb, state->fd[0],
+			    TEVENT_FD_READ, helper_handler, state);
+	if (fde == NULL) {
+		goto fail;
+	}
+	tevent_fd_set_auto_close(fde);
+
+	while (!state->done) {
+		tevent_loop_once(rec->ctdb->ev);
+	}
+
+	close(state->fd[0]);
+	state->fd[0] = -1;
+
+	if (state->result != 0) {
+		goto fail;
+	}
+
+	ctdb_kill(rec->ctdb, state->pid, SIGKILL);
+	talloc_free(state);
+	return 0;
+
+fail:
+	if (state->fd[0] != -1) {
+		close(state->fd[0]);
+	}
+	if (state->fd[1] != -1) {
+		close(state->fd[1]);
+	}
+	if (state->pid != -1) {
+		ctdb_kill(rec->ctdb, state->pid, SIGKILL);
+	}
+	talloc_free(state);
+	return -1;
+}
+
+
+static int ctdb_takeover(struct ctdb_recoverd *rec,
+			 uint32_t *force_rebalance_nodes)
+{
+	static char prog[PATH_MAX+1] = "";
+	char *arg;
+	int i;
+
+	if (!ctdb_set_helper("takeover_helper", prog, sizeof(prog),
+			     "CTDB_TAKEOVER_HELPER", CTDB_HELPER_BINDIR,
+			     "ctdb_takeover_helper")) {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list