recoverd: Fix tunable NoIPTakeoverOnDisabled, rename to NoIPHostOnAllDisabled
authorMartin Schwenke <martin@meltin.net>
Fri, 3 May 2013 06:59:20 +0000 (16:59 +1000)
committerMartin Schwenke <martin@meltin.net>
Tue, 7 May 2013 06:20:46 +0000 (16:20 +1000)
commit1308a51f73f2e29ba4dbebb6111d9309a89732cc
tree5874d936ddb0b9f46ea6dc9b62fc4a15784fed43
parent12aef10e9889760d98f58c8d916f19d069fa381a
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>
doc/ctdbd.1.xml
include/ctdb_private.h
include/ctdb_protocol.h
server/ctdb_takeover.c
server/ctdb_tunables.c
tests/src/ctdb_takeover_tests.c
tests/takeover/lcp2.017.sh
tests/takeover/lcp2.018.sh
tests/takeover/lcp2.019.sh