diff options
author | Martin Schwenke <martin@meltin.net> | 2013-05-03 16:59:20 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2013-05-07 16:20:46 +1000 |
commit | 0445c988e241c9528a339707ac0dcf49148b18c1 (patch) | |
tree | 27d8df6e1bed645d30957404250bdcd3784c6bd3 /ctdb/tests/src | |
parent | ac80824709f7feda8bf5a81ca9468897de902923 (diff) | |
download | samba-0445c988e241c9528a339707ac0dcf49148b18c1.tar.gz samba-0445c988e241c9528a339707ac0dcf49148b18c1.tar.xz samba-0445c988e241c9528a339707ac0dcf49148b18c1.zip |
recoverd: Fix tunable NoIPTakeoverOnDisabled, rename to NoIPHostOnAllDisabled
This really needs to be per-node. The rename is because nodes with
this tunable switched on should drop IPs if they become unhealthy (or
disabled in some other way).
* Add new flag NODE_FLAGS_NOIPHOST, only used in recovery daemon.
* Enhance set_ipflags_internal() and set_ipflags() to setup
NODE_FLAGS_NOIPHOST depending on setting of NoIPHostOnAllDisabled
and/or whether nodes are disabled/inactive.
* Replace can_node_servce_ip() with functions can_node_host_ip() and
can_node_takeover_ip(). These functions are the only ones that need
to look at NODE_FLAGS_NOIPTAKEOVER and NODE_FLAGS_NOIPHOST. They
can make the decision without looking at any other flags due to
previous setup.
* Remove explicit flag checking in IP allocation functions (including
unassign_unsuitable_ips()) and just call can_node_host_ip() and
can_node_takeover_ip() as appropriate.
* Update test code to handle CTDB_SET_NoIPHostOnAllDisabled.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 1308a51f73f2e29ba4dbebb6111d9309a89732cc)
Diffstat (limited to 'ctdb/tests/src')
-rw-r--r-- | ctdb/tests/src/ctdb_takeover_tests.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ctdb/tests/src/ctdb_takeover_tests.c b/ctdb/tests/src/ctdb_takeover_tests.c index 9083af8f792..89894f8ea4b 100644 --- a/ctdb/tests/src/ctdb_takeover_tests.c +++ b/ctdb/tests/src/ctdb_takeover_tests.c @@ -363,6 +363,7 @@ void ctdb_test_init(const char nodestates[], uint32_t nodeflags[CTDB_TEST_MAX_NODES]; char *tok, *ns, *t; uint32_t *tval_noiptakeover; + uint32_t *tval_noiptakeoverondisabled; *ctdb = talloc_zero(NULL, struct ctdb_context); @@ -400,13 +401,11 @@ void ctdb_test_init(const char nodestates[], } } - (*ctdb)->tunable.no_ip_takeover_on_disabled = 0; - if (getenv("CTDB_SET_NoIPTakeoverOnDisabled")) { - (*ctdb)->tunable.no_ip_takeover_on_disabled = (uint32_t) strtoul(getenv("CTDB_SET_NoIPTakeoverOnDisabled"), NULL, 0); - } - tval_noiptakeover = get_tunable_values(*ctdb, numnodes, "CTDB_SET_NoIPTakeover"); + tval_noiptakeoverondisabled = + get_tunable_values(*ctdb, numnodes, + "CTDB_SET_NoIPHostOnAllDisabled"); *nodemap = talloc_array(*ctdb, struct ctdb_node_map, numnodes); (*nodemap)->num = numnodes; @@ -427,7 +426,7 @@ void ctdb_test_init(const char nodestates[], (*ctdb)->nodes[i]->known_public_ips = avail[i]; } - set_ipflags_internal(*nodemap, tval_noiptakeover); + set_ipflags_internal(*nodemap, tval_noiptakeover, tval_noiptakeoverondisabled); } /* IP layout is read from stdin. */ |