From e1692fb0a0fae98115be87fff6330a354865f52b Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Thu, 9 Jan 2014 15:44:25 -0800 Subject: [PATCH] Adding a ReconcileInterval config --- consul/config.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/consul/config.go b/consul/config.go index 1390705b0..4f0d3cc37 100644 --- a/consul/config.go +++ b/consul/config.go @@ -7,6 +7,7 @@ import ( "io" "net" "os" + "time" ) const ( @@ -54,6 +55,12 @@ type Config struct { // SerfWANConfig is the configuration for the cross-dc serf SerfWANConfig *serf.Config + // ReconcileInterval controls how often we reconcile the strongly + // consistent store with the Serf info. This is used to handle nodes + // that are force removed, as well as intermittent unavailability during + // leader election. + ReconcileInterval time.Duration + // LogOutput is the location to write logs to. If this is not set, // logs will go to stderr. LogOutput io.Writer @@ -67,12 +74,13 @@ func DefaultConfig() *Config { } conf := &Config{ - Datacenter: DefaultDC, - NodeName: hostname, - RPCAddr: DefaultRPCAddr, - RaftConfig: raft.DefaultConfig(), - SerfLANConfig: serf.DefaultConfig(), - SerfWANConfig: serf.DefaultConfig(), + Datacenter: DefaultDC, + NodeName: hostname, + RPCAddr: DefaultRPCAddr, + RaftConfig: raft.DefaultConfig(), + SerfLANConfig: serf.DefaultConfig(), + SerfWANConfig: serf.DefaultConfig(), + ReconcileInterval: 60 * time.Second, } // WAN Serf should use the WAN timing, since we are using it