will stopp any ip reallocations at all from happening.
uint32_t deterministic_public_ips;
uint32_t reclock_ping_period;
uint32_t no_ip_failback;
+ uint32_t disable_ip_failover;
uint32_t verbose_memory_names;
uint32_t recd_ping_timeout;
uint32_t recd_ping_failcount;
uint32_t recovery_master;
struct ctdb_call_state *pending_calls;
struct ctdb_client_ip *client_ip_list;
- bool do_checkpublicip;
struct trbt_tree *server_ids;
const char *event_script_dir;
const char *notification_script;
struct ctdb_req_control *c,
TDB_DATA *outdata);
+int ctdb_deferred_drop_all_ips(struct ctdb_context *ctdb);
+
#endif
tevent_fd_set_auto_close(fde);
/* release any IPs we hold from previous runs of the daemon */
- ctdb_release_all_ips(ctdb);
+ if (ctdb->tunable.disable_ip_failover == 0) {
+ ctdb_release_all_ips(ctdb);
+ }
/* start the transport going */
ctdb_start_transport(ctdb);
ctdb_release_all_ips(ctdb);
}
+/*
+ * Set up an event to drop all public ips if we remain in recovery for too
+ * long
+ */
+int ctdb_deferred_drop_all_ips(struct ctdb_context *ctdb)
+{
+ if (ctdb->release_ips_ctx != NULL) {
+ talloc_free(ctdb->release_ips_ctx);
+ }
+ ctdb->release_ips_ctx = talloc_new(ctdb);
+ CTDB_NO_MEMORY(ctdb, ctdb->release_ips_ctx);
+
+ event_add_timed(ctdb->ev, ctdb->release_ips_ctx, timeval_current_ofs(ctdb->tunable.recovery_drop_all_ips, 0), ctdb_drop_all_ips_event, ctdb);
+ return 0;
+}
+
/*
set the recovery mode
*/
talloc_free(ctdb->release_ips_ctx);
ctdb->release_ips_ctx = NULL;
} else {
- talloc_free(ctdb->release_ips_ctx);
- ctdb->release_ips_ctx = talloc_new(ctdb);
- CTDB_NO_MEMORY(ctdb, ctdb->release_ips_ctx);
-
- event_add_timed(ctdb->ev, ctdb->release_ips_ctx, timeval_current_ofs(ctdb->tunable.recovery_drop_all_ips, 0), ctdb_drop_all_ips_event, ctdb);
+ if (ctdb_deferred_drop_all_ips(ctdb) != 0) {
+ DEBUG(DEBUG_ERR,("Failed to set up deferred drop all ips\n"));
+ }
}
if (recmode != ctdb->recovery_mode) {
/* verify that we have all ip addresses we should have and we dont
* have addresses we shouldnt have.
*/
- if (ctdb->do_checkpublicip) {
+ if (ctdb->tunable.disable_ip_failover != 0) {
if (rec->ip_check_disable_ctx == NULL) {
if (verify_local_ip_allocation(ctdb, rec, pnn) != 0) {
DEBUG(DEBUG_ERR, (__location__ " Public IPs were inconsistent.\n"));
struct ctdb_client_control_state *state;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
+ /*
+ * ip failover is completely disabled, just send out the
+ * ipreallocated event.
+ */
+ if (ctdb->tunable.disable_ip_failover != 0) {
+ goto ipreallocated;
+ }
ZERO_STRUCT(ip);
return -1;
}
+ipreallocated:
/* tell all nodes to update natwg */
/* send the flags update natgw on all connected nodes */
data.dptr = discard_const("ipreallocated");
{ "DeterministicIPs", 1, offsetof(struct ctdb_tunable, deterministic_public_ips) },
{ "ReclockPingPeriod", 60, offsetof(struct ctdb_tunable, reclock_ping_period) },
{ "NoIPFailback", 0, offsetof(struct ctdb_tunable, no_ip_failback) },
+ { "DisableIPFailover", 0, offsetof(struct ctdb_tunable, disable_ip_failover) },
{ "VerboseMemoryNames", 0, offsetof(struct ctdb_tunable, verbose_memory_names) },
{ "RecdPingTimeout", 60, offsetof(struct ctdb_tunable, recd_ping_timeout) },
{ "RecdFailCount", 10, offsetof(struct ctdb_tunable, recd_ping_failcount) },
ctdb_tunables_set_defaults(ctdb);
+ ctdb->tunable.disable_ip_failover = options.no_publicipcheck;
ret = ctdb_set_recovery_lock_file(ctdb, options.recovery_lock_file);
if (ret == -1) {
ctdb->valgrinding = options.valgrinding;
- ctdb->do_checkpublicip = !options.no_publicipcheck;
-
if (options.max_persistent_check_errors < 0) {
ctdb->max_persistent_check_errors = 0xFFFFFFFFFFFFFFFFLL;
} else {