diff --git a/config.go b/config.go index 17841c967..f2dd41793 100644 --- a/config.go +++ b/config.go @@ -90,25 +90,25 @@ const ( DefaultGossipProbeInterval = 1 * time.Second DefaultGossipProbeTimeout = 500 * time.Millisecond - // GossipInterval and GossipNodes are used to configure the gossip + // Interval and Nodes are used to configure the gossip // behavior of memberlist. // - // GossipInterval is the interval between sending messages that need + // Interval is the interval between sending messages that need // to be gossiped that haven't been able to piggyback on probing messages. // If this is set to zero, non-piggyback gossip is disabled. By lowering // this value (more frequent) gossip messages are propagated across // the cluster more quickly at the expense of increased bandwidth. // - // GossipNodes is the number of random nodes to send gossip messages to - // per GossipInterval. Increasing this number causes the gossip messages + // Nodes is the number of random nodes to send gossip messages to + // per Interval. Increasing this number causes the gossip messages // to propagate across the cluster more quickly at the expense of // increased bandwidth. // - // GossipToTheDeadTime is the interval after which a node has died that + // ToTheDeadTime is the interval after which a node has died that // we will still try to gossip to it. This gives it a chance to refute. - DefaultGossipGossipInterval = 200 * time.Millisecond - DefaultGossipGossipNodes = 3 - DefaultGossipGossipToTheDeadTime = 30 * time.Second + DefaultGossipInterval = 200 * time.Millisecond + DefaultGossipNodes = 3 + DefaultGossipToTheDeadTime = 30 * time.Second DefaultMetricPollInterval = 0 * time.Minute ) @@ -146,17 +146,17 @@ type Config struct { } `toml:"cluster"` Gossip struct { - Port string `toml:"port"` - Seeds []string `toml:"seeds"` - Key string `toml:"key"` - StreamTimeout Duration `toml:"stream-timeout"` - SuspicionMult int `toml:"suspicion-mult"` - PushPullInterval Duration `toml:"push-pull-interval"` - ProbeTimeout Duration `toml:"probe-timeout"` - ProbeInterval Duration `toml:"probe-interval"` - GossipNodes int `toml:"gossip-nodes"` - GossipInterval Duration `toml:"gossip-interval"` - GossipToTheDeadTime Duration `toml:"gossip-to-the-dead-time"` + Port string `toml:"port"` + Seeds []string `toml:"seeds"` + Key string `toml:"key"` + StreamTimeout Duration `toml:"stream-timeout"` + SuspicionMult int `toml:"suspicion-mult"` + PushPullInterval Duration `toml:"push-pull-interval"` + ProbeTimeout Duration `toml:"probe-timeout"` + ProbeInterval Duration `toml:"probe-interval"` + Nodes int `toml:"nodes"` + Interval Duration `toml:"interval"` + ToTheDeadTime Duration `toml:"to-the-dead-time"` } `toml:"gossip"` AntiEntropy struct { @@ -197,9 +197,9 @@ func NewConfig() *Config { c.Gossip.PushPullInterval = Duration(DefaultGossipPushPullInterval) c.Gossip.ProbeTimeout = Duration(DefaultGossipProbeTimeout) c.Gossip.ProbeInterval = Duration(DefaultGossipProbeInterval) - c.Gossip.GossipNodes = DefaultGossipGossipNodes - c.Gossip.GossipInterval = Duration(DefaultGossipGossipInterval) - c.Gossip.GossipToTheDeadTime = Duration(DefaultGossipGossipToTheDeadTime) + c.Gossip.Nodes = DefaultGossipNodes + c.Gossip.Interval = Duration(DefaultGossipInterval) + c.Gossip.ToTheDeadTime = Duration(DefaultGossipToTheDeadTime) // AntiEntropy config. c.AntiEntropy.Interval = Duration(DefaultAntiEntropyInterval) diff --git a/ctl/server.go b/ctl/server.go index e18f1a296..87d6a8e15 100644 --- a/ctl/server.go +++ b/ctl/server.go @@ -48,9 +48,9 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) { flags.DurationVarP((*time.Duration)(&srv.Config.Gossip.PushPullInterval), "gossip.push-pull-interval", "", (time.Duration)(srv.Config.Gossip.PushPullInterval), "Interval between complete state syncs.") flags.DurationVarP((*time.Duration)(&srv.Config.Gossip.ProbeTimeout), "gossip.probe-timeout", "", (time.Duration)(srv.Config.Gossip.ProbeTimeout), "Timeout to wait for an ack from a probed node before assuming it is unhealthy.") flags.DurationVarP((*time.Duration)(&srv.Config.Gossip.ProbeInterval), "gossip.probe-interval", "", (time.Duration)(srv.Config.Gossip.ProbeInterval), "Interval between random node probes.") - flags.IntVarP(&srv.Config.Gossip.GossipNodes, "gossip.gossip-nodes", "", srv.Config.Gossip.GossipNodes, "Number of random nodes to send gossip messages to per GossipInterval.") - flags.DurationVarP((*time.Duration)(&srv.Config.Gossip.GossipInterval), "gossip.gossip-interval", "", (time.Duration)(srv.Config.Gossip.GossipInterval), "Interval between sending messages that need to be gossiped that haven't piggybacked on probing messages.") - flags.DurationVarP((*time.Duration)(&srv.Config.Gossip.GossipToTheDeadTime), "gossip.gossip-to-the-dead-time", "", (time.Duration)(srv.Config.Gossip.GossipToTheDeadTime), "Interval after which a node has died that we will still try to gossip to it.") + flags.IntVarP(&srv.Config.Gossip.Nodes, "gossip.nodes", "", srv.Config.Gossip.Nodes, "Number of random nodes to send gossip messages to per GossipInterval.") + flags.DurationVarP((*time.Duration)(&srv.Config.Gossip.Interval), "gossip.interval", "", (time.Duration)(srv.Config.Gossip.Interval), "Interval between sending messages that need to be gossiped that haven't piggybacked on probing messages.") + flags.DurationVarP((*time.Duration)(&srv.Config.Gossip.ToTheDeadTime), "gossip.to-the-dead-time", "", (time.Duration)(srv.Config.Gossip.ToTheDeadTime), "Interval after which a node has died that we will still try to gossip to it.") // AntiEntropy flags.DurationVarP((*time.Duration)(&srv.Config.AntiEntropy.Interval), "anti-entropy.interval", "", (time.Duration)(srv.Config.AntiEntropy.Interval), "Interval at which to run anti-entropy routine.") diff --git a/gossip/gossip.go b/gossip/gossip.go index 0949feb16..866d2e41e 100644 --- a/gossip/gossip.go +++ b/gossip/gossip.go @@ -187,9 +187,9 @@ func NewGossipMemberSetWithTransport(name string, cfg *pilosa.Config, transport conf.PushPullInterval = time.Duration(cfg.Gossip.PushPullInterval) conf.ProbeTimeout = time.Duration(cfg.Gossip.ProbeTimeout) conf.ProbeInterval = time.Duration(cfg.Gossip.ProbeInterval) - conf.GossipNodes = cfg.Gossip.GossipNodes - conf.GossipInterval = time.Duration(cfg.Gossip.GossipInterval) - conf.GossipToTheDeadTime = time.Duration(cfg.Gossip.GossipToTheDeadTime) + conf.GossipNodes = cfg.Gossip.Nodes + conf.GossipInterval = time.Duration(cfg.Gossip.Interval) + conf.GossipToTheDeadTime = time.Duration(cfg.Gossip.ToTheDeadTime) // conf.Delegate = g conf.SecretKey = gossipKey