struct ctdb_node_map *nodemap,
bool banning_credits_on_fail)
{
+ uint32_t disable_timeout;
+ TDB_DATA data;
int ret;
bool ok;
goto done;
}
+ /* Disable IP checks while doing this takeover run. This will
+ * stop those other nodes from triggering takeover runs when
+ * think they should be hosting an IP but it isn't yet on an
+ * interface.
+ */
+ data.dptr = (uint8_t*)&disable_timeout;
+ data.dsize = sizeof(disable_timeout);
+
+ disable_timeout = rec->ctdb->tunable.takeover_timeout;
+ if (ctdb_client_send_message(rec->ctdb, CTDB_BROADCAST_CONNECTED,
+ CTDB_SRVID_DISABLE_IP_CHECK,
+ data) != 0) {
+ DEBUG(DEBUG_INFO,("Failed to disable IP check\n"));
+ }
+
rec->takeover_run_in_progress = true;
ret = ctdb_takeover_run(rec->ctdb, nodemap, takeover_fail_callback,
banning_credits_on_fail ? rec : NULL);
+
+ /* Reenable IP checks */
+ disable_timeout = 0;
+ if (ctdb_client_send_message(rec->ctdb, CTDB_BROADCAST_CONNECTED,
+ CTDB_SRVID_DISABLE_IP_CHECK,
+ data) != 0) {
+ DEBUG(DEBUG_INFO,("Failed to reenable IP check\n"));
+ }
+
if (ret != 0) {
DEBUG(DEBUG_ERR, ("IP reallocation failed\n"));
ok = false;
struct client_async_data *async_data;
struct ctdb_client_control_state *state;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
- uint32_t disable_timeout;
struct ctdb_ipflags *ipflags;
struct takeover_callback_data *takeover_data;
struct iprealloc_callback_data iprealloc_data;
/* Do the IP reassignment calculations */
ctdb_takeover_run_core(ctdb, ipflags, &all_ips);
- /* The recovery daemon does regular sanity checks of the IPs.
- * However, sometimes it is overzealous and thinks changes are
- * required when they're already underway. This stops the
- * checks for a while before we start moving IPs.
- */
- disable_timeout = ctdb->tunable.takeover_timeout;
- data.dptr = (uint8_t*)&disable_timeout;
- data.dsize = sizeof(disable_timeout);
- if (ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED,
- CTDB_SRVID_DISABLE_IP_CHECK, data) != 0) {
- DEBUG(DEBUG_INFO,("Failed to disable ip verification\n"));
- }
-
/* Now tell all nodes to release any public IPs should not
* host. This will be a NOOP on nodes that don't currently
* hold the given IP.