From 652014539c6fa10333e55f07f2c5becdaab941fc Mon Sep 17 00:00:00 2001 From: Travis Date: Wed, 3 Feb 2021 22:36:38 -0600 Subject: [PATCH] remove temporary Gossiper interface --- server.go | 14 -------------- server/cluster_test.go | 18 +++++++++--------- server/server.go | 7 ------- test/pilosa.go | 7 ------- translator_test.go | 2 +- 5 files changed, 10 insertions(+), 38 deletions(-) diff --git a/server.go b/server.go index 5badf260f..bb62645cb 100644 --- a/server.go +++ b/server.go @@ -73,9 +73,6 @@ type Server struct { // nolint: maligned sharder disco.Sharder schemator disco.Schemator - // TODO: this is VERY temporary!!! - Gossiper Gossiper - // External systemInfo SystemInfo gcNotifier GCNotifier @@ -527,10 +524,6 @@ func (s *Server) UpAndDown() error { return nil } -type Gossiper interface { - StartGossip() error -} - // Open opens and initializes the server. func (s *Server) Open() error { s.logger.Printf("open server. PID %v", os.Getpid()) @@ -597,13 +590,6 @@ func (s *Server) Open() error { return errors.Wrap(err, "setting up cluster") } - // ---------- TODO: this is temporary - if s.Gossiper != nil { - if err := s.Gossiper.StartGossip(); err != nil { - return errors.Wrap(err, "starting gossip") - } - } - // Open Cluster management. if err := s.cluster.waitForStarted(); err != nil { return errors.Wrap(err, "opening Cluster") diff --git a/server/cluster_test.go b/server/cluster_test.go index 8700d6bc6..23668c64f 100644 --- a/server/cluster_test.go +++ b/server/cluster_test.go @@ -173,7 +173,7 @@ func TestClusterResize_AddNode(t *testing.T) { m0 := test.MustRunCluster(t, 1).GetNode(0) defer m0.Close() - seed := m0.GossipAddress() + seed := "" // Create a client for each node. client0 := m0.Client() @@ -219,7 +219,7 @@ func TestClusterResize_AddNode(t *testing.T) { m0 := test.MustRunCluster(t, 1).GetNode(0) defer m0.Close() - seed := m0.GossipAddress() + seed := "" // Create a client for each node. client0 := m0.Client() @@ -283,7 +283,7 @@ func TestClusterResize_AddNode(t *testing.T) { m0 := test.MustRunCluster(t, 1).GetNode(0) defer m0.Close() - seed := m0.GossipAddress() + seed := "" // Create a client for each node. client0 := m0.Client() @@ -345,7 +345,7 @@ func TestClusterResize_AddNode(t *testing.T) { m0 := test.MustRunCluster(t, 1).GetNode(0) defer m0.Close() - seed := m0.GossipAddress() + seed := "" // Create a client for each node. client0 := m0.Client() @@ -416,7 +416,7 @@ func TestClusterResize_AddNodeConcurrentIndex(t *testing.T) { m0 := test.MustRunCluster(t, 1).GetNode(0) defer m0.Close() - seed := m0.GossipAddress() + seed := "" // Create a client for each node. client0 := m0.Client() @@ -468,7 +468,7 @@ func TestClusterResize_AddNodeConcurrentIndex(t *testing.T) { m0 := test.MustRunCluster(t, 1).GetNode(0) defer m0.Close() - seed := m0.GossipAddress() + seed := "" // Create a client for each node. client0 := m0.Client() @@ -536,7 +536,7 @@ func TestClusterResize_AddNodeConcurrentIndex(t *testing.T) { m0 := test.MustRunCluster(t, 1).GetNode(0) defer m0.Close() - seed := m0.GossipAddress() + seed := "" // Create a client for each node. client0 := m0.Client() @@ -604,7 +604,7 @@ func TestClusterResize_AddNodeConcurrentIndex(t *testing.T) { m0 := test.MustRunCluster(t, 1).GetNode(0) defer m0.Close() - seed := m0.GossipAddress() + seed := "" // Create a client for each node. client0 := m0.Client() @@ -672,7 +672,7 @@ func TestCluster_GossipMembership(t *testing.T) { m0 := test.MustRunCluster(t, 1).GetNode(0) defer m0.Close() - seed := m0.GossipAddress() + seed := "" var eg errgroup.Group diff --git a/server/server.go b/server/server.go index 5282e3d6d..00ab4d547 100644 --- a/server/server.go +++ b/server/server.go @@ -151,10 +151,6 @@ func NewCommand(stdin io.Reader, stdout, stderr io.Writer, opts ...CommandOption return c } -func (m *Command) StartGossip() (err error) { - return m.setupNetworking() -} - // Start starts the pilosa server - it returns once the server is running. func (m *Command) Start() (err error) { // Seed random number generator @@ -166,9 +162,6 @@ func (m *Command) Start() (err error) { return errors.Wrap(err, "setting up server") } - // TODO: this is temporary. - m.Server.Gossiper = m - if runtime.GOOS == "linux" { result, err := ioutil.ReadFile("/proc/sys/vm/max_map_count") if err != nil { diff --git a/test/pilosa.go b/test/pilosa.go index 92e82e077..13993e199 100644 --- a/test/pilosa.go +++ b/test/pilosa.go @@ -108,13 +108,6 @@ func RunCommand(t *testing.T) *Command { return MustRunCluster(t, 1).GetNode(0) } -// GossipAddress returns the address on which gossip is listening after a Main -// has been setup. Useful to pass as a seed to other nodes when creating and -// testing clusters. -func (m *Command) GossipAddress() string { - return m.GossipTransport().URI.String() -} - // Close closes the program and removes the underlying data directory. func (m *Command) Close() error { // leave the removing part to the test logic. Some tests are closing and opening again the command diff --git a/translator_test.go b/translator_test.go index d8fd79d82..ddaff794b 100644 --- a/translator_test.go +++ b/translator_test.go @@ -263,7 +263,7 @@ func TestTranslation_Reset(t *testing.T) { if err := node0.SoftOpen(); err != nil { t.Fatal(err) } - gossipSeeds := []string{node0.GossipAddress()} + gossipSeeds := []string{} node1.Config.Gossip.Seeds = gossipSeeds if err := node1.SoftOpen(); err != nil {