From 42d69d6c5d107caf969430f51516525809502eec Mon Sep 17 00:00:00 2001 From: Travis Date: Thu, 4 Mar 2021 13:51:18 -0600 Subject: [PATCH] Remove gossip config --- ctl/server.go | 16 --------- gossip/gossip.go | 93 ------------------------------------------------ server/config.go | 19 ---------- 3 files changed, 128 deletions(-) delete mode 100644 gossip/gossip.go diff --git a/ctl/server.go b/ctl/server.go index fc2141945..e6469ffbd 100644 --- a/ctl/server.go +++ b/ctl/server.go @@ -55,22 +55,6 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) { flags.StringVar(&srv.Config.Translation.PrimaryURL, "translation.primary-url", srv.Config.Translation.PrimaryURL, "DEPRECATED: URL for primary translation node for replication.") flags.IntVar(&srv.Config.Translation.MapSize, "translation.map-size", srv.Config.Translation.MapSize, "Size in bytes of mmap to allocate for key translation.") - // Gossip - flags.StringVar(&srv.Config.Gossip.Port, "gossip.port", srv.Config.Gossip.Port, "Port to which pilosa should bind for internal state sharing.") - flags.StringVar(&srv.Config.Gossip.AdvertiseHost, "gossip.advertise-host", srv.Config.Gossip.AdvertiseHost, "Host on which memberlist should advertise.") - flags.StringVar(&srv.Config.Gossip.AdvertisePort, "gossip.advertise-port", srv.Config.Gossip.AdvertisePort, "Port on which memberlist should advertise.") - - flags.StringSliceVar(&srv.Config.Gossip.Seeds, "gossip.seeds", srv.Config.Gossip.Seeds, "Host with which to seed the gossip membership.") - flags.StringVar(&srv.Config.Gossip.Key, "gossip.key", srv.Config.Gossip.Key, "The path to file of the encryption key for gossip. The contents of the file should be either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.") - flags.DurationVar((*time.Duration)(&srv.Config.Gossip.StreamTimeout), "gossip.stream-timeout", (time.Duration)(srv.Config.Gossip.StreamTimeout), "Timeout for establishing a stream connection with a remote node for a full state sync.") - flags.IntVar(&srv.Config.Gossip.SuspicionMult, "gossip.suspicion-mult", srv.Config.Gossip.SuspicionMult, "Multiplier for determining the time an inaccessible node is considered suspect before declaring it dead.") - flags.DurationVar((*time.Duration)(&srv.Config.Gossip.PushPullInterval), "gossip.push-pull-interval", (time.Duration)(srv.Config.Gossip.PushPullInterval), "Interval between complete state syncs.") - flags.DurationVar((*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.DurationVar((*time.Duration)(&srv.Config.Gossip.ProbeInterval), "gossip.probe-interval", (time.Duration)(srv.Config.Gossip.ProbeInterval), "Interval between random node probes.") - flags.IntVar(&srv.Config.Gossip.Nodes, "gossip.nodes", srv.Config.Gossip.Nodes, "Number of random nodes to send gossip messages to per GossipInterval.") - flags.DurationVar((*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.DurationVar((*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.") - // Etcd // Etcd.Name used Config.Name for it's value. // Etcd.Dir defaults to a directory under the pilosa data directory. diff --git a/gossip/gossip.go b/gossip/gossip.go deleted file mode 100644 index 10b3e2d0e..000000000 --- a/gossip/gossip.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2017 Pilosa Corp. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gossip - -import ( - "github.com/pilosa/pilosa/v2/toml" -) - -// Config holds toml-friendly memberlist configuration. -type Config struct { - // Port indicates the port to which pilosa should bind for internal state sharing. - Port string `toml:"port"` - - // AdvertiseHost is the hostname or IP other nodes should use to connect to - // this host. If left blank, the value for Host will be used. This is useful - // in some proxy and NAT scenarios. - AdvertiseHost string `toml:"advertise-host"` - // AdvertisePort is the port other nodes will use to connect to this one. - // Behaves like AdvertiseHost. - AdvertisePort string `toml:"advertise-port"` - - Seeds []string `toml:"seeds"` - Key string `toml:"key"` - // StreamTimeout is the timeout for establishing a stream connection with - // a remote node for a full state sync, and for stream read and write - // operations. Maps to memberlist TCPTimeout. - StreamTimeout toml.Duration `toml:"stream-timeout"` - // SuspicionMult is the multiplier for determining the time an - // inaccessible node is considered suspect before declaring it dead. - // The actual timeout is calculated using the formula: - // - // SuspicionTimeout = SuspicionMult * log(N+1) * ProbeInterval - // - // This allows the timeout to scale properly with expected propagation - // delay with a larger cluster size. The higher the multiplier, the longer - // an inaccessible node is considered part of the cluster before declaring - // it dead, giving that suspect node more time to refute if it is indeed - // still alive. - SuspicionMult int `toml:"suspicion-mult"` - // PushPullInterval is the interval between complete state syncs. - // Complete state syncs are done with a single node over TCP and are - // quite expensive relative to standard gossiped messages. Setting this - // to zero will disable state push/pull syncs completely. - // - // Setting this interval lower (more frequent) will increase convergence - // speeds across larger clusters at the expense of increased bandwidth - // usage. - PushPullInterval toml.Duration `toml:"push-pull-interval"` - // ProbeInterval and ProbeTimeout are used to configure probing behavior - // for memberlist. - // - // ProbeInterval is the interval between random node probes. Setting - // this lower (more frequent) will cause the memberlist cluster to detect - // failed nodes more quickly at the expense of increased bandwidth usage. - // - // ProbeTimeout is the timeout to wait for an ack from a probed node - // before assuming it is unhealthy. This should be set to 99-percentile - // of RTT (round-trip time) on your network. - ProbeInterval toml.Duration `toml:"probe-interval"` - ProbeTimeout toml.Duration `toml:"probe-timeout"` - - // Interval and Nodes are used to configure the gossip - // behavior of memberlist. - // - // 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. - // - // 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. - // - // 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. - Interval toml.Duration `toml:"interval"` - Nodes int `toml:"nodes"` - ToTheDeadTime toml.Duration `toml:"to-the-dead-time"` -} diff --git a/server/config.go b/server/config.go index 6ae013bab..1c004b7e8 100644 --- a/server/config.go +++ b/server/config.go @@ -25,7 +25,6 @@ import ( "time" petcd "github.com/pilosa/pilosa/v2/etcd" - "github.com/pilosa/pilosa/v2/gossip" rbfcfg "github.com/pilosa/pilosa/v2/rbf/cfg" "github.com/pilosa/pilosa/v2/storage" "github.com/pilosa/pilosa/v2/toml" @@ -140,8 +139,6 @@ type Config struct { Etcd petcd.Options `toml:"etcd"` LongQueryTime toml.Duration `toml:"long-query-time"` - // Gossip config is based around memberlist.Config. - Gossip gossip.Config `toml:"gossip"` Translation struct { MapSize int `toml:"map-size"` @@ -248,8 +245,6 @@ func (c *Config) validate() error { "Etcd.LPeerURL", c.Etcd.LPeerURL, // ":" "Etcd.APeerURL", c.Etcd.APeerURL, // "" "Etcd.ClusterURL", c.Etcd.ClusterURL, - "Gossip.Port", fmt.Sprintf(":%v", c.Gossip.Port), - "Gossip.AdvertisePort", fmt.Sprintf(":%v", c.Gossip.AdvertisePort), "Postgres.Bind", c.Postgres.Bind, } ports := make(map[int]bool) @@ -266,9 +261,6 @@ func (c *Config) validate() error { if name == "AdvertiseGRPC" && (hp == "" || hp == ":") { continue } - if name == "Gossip.AdvertisePort" && (hp == "" || hp == ":") { - continue - } hp = strings.TrimPrefix(hp, "http://") hp = strings.TrimPrefix(hp, "https://") @@ -327,17 +319,6 @@ func NewConfig() *Config { c.Cluster.ReplicaN = 1 c.Cluster.LongQueryTime = toml.Duration(-time.Minute) //TODO remove this once cluster.longQueryTime is fully deprecated - // Gossip config. - c.Gossip.Port = "14000" - c.Gossip.StreamTimeout = toml.Duration(10 * time.Second) - c.Gossip.SuspicionMult = 4 - c.Gossip.PushPullInterval = toml.Duration(30 * time.Second) - c.Gossip.ProbeInterval = toml.Duration(1 * time.Second) - c.Gossip.ProbeTimeout = toml.Duration(500 * time.Millisecond) - c.Gossip.Interval = toml.Duration(200 * time.Millisecond) - c.Gossip.Nodes = 3 - c.Gossip.ToTheDeadTime = toml.Duration(30 * time.Second) - // AntiEntropy config. c.AntiEntropy.Interval = toml.Duration(0)