From 38ea6708dd16f88966ae5157fe523f4758317186 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Fri, 24 Apr 2009 18:23:48 +1000 Subject: [PATCH] add a tuneable RecoveryDropAllIPs so it is possible to control after how long a node that has been stuck in recovery will wait until it will yield all public addresses. this now defaults to 60 seconds This is useful if a split brain occurs due to network partitioning since it will make sure that the "other half" of the cluster that does not contain the recovery master will eventually release all ips and thus avoiding a duplicate ip situation for the public addresses (This used to be ctdb commit 70f21428c9eec96bcc787be191e7478ad68956dc) --- ctdb/include/ctdb_private.h | 1 + ctdb/server/ctdb_recover.c | 2 +- ctdb/server/ctdb_tunables.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 88e686bc9ba..2231d339873 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -105,6 +105,7 @@ struct ctdb_tunable { uint32_t recd_ping_timeout; uint32_t recd_ping_failcount; uint32_t log_latency_ms; + uint32_t recovery_drop_all_ips; }; /* diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c index fd35dce2663..f9112a3ff4b 100644 --- a/ctdb/server/ctdb_recover.c +++ b/ctdb/server/ctdb_recover.c @@ -600,7 +600,7 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb, 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(35,0), ctdb_drop_all_ips_event, ctdb); + 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); } diff --git a/ctdb/server/ctdb_tunables.c b/ctdb/server/ctdb_tunables.c index 330ab1999c3..7fa5e808c50 100644 --- a/ctdb/server/ctdb_tunables.c +++ b/ctdb/server/ctdb_tunables.c @@ -53,6 +53,7 @@ static const struct { { "RecdPingTimeout", 20, offsetof(struct ctdb_tunable, recd_ping_timeout) }, { "RecdFailCount", 3, offsetof(struct ctdb_tunable, recd_ping_failcount) }, { "LogLatencyMs", 0, offsetof(struct ctdb_tunable, log_latency_ms) }, + { "RecoveryDropAllIPs", 60, offsetof(struct ctdb_tunable, recovery_drop_all_ips) }, }; /*