remove temporary Gossiper interface

This commit is contained in:
Travis 2021-02-03 22:36:38 -06:00
parent 6e4ea21ce5
commit 652014539c
No known key found for this signature in database
GPG key ID: 37080CC2042BA34E
5 changed files with 10 additions and 38 deletions

View file

@ -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")

View file

@ -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

View file

@ -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 {

View file

@ -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

View file

@ -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 {