linter fixes

This commit is contained in:
Travis 2021-02-03 15:10:58 -06:00
parent f9661b7b81
commit da804ee6d5
No known key found for this signature in database
GPG key ID: 37080CC2042BA34E
2 changed files with 7 additions and 21 deletions

View file

@ -50,9 +50,8 @@ const (
ClusterStateResizing = disco.ClusterStateResizing
ClusterStateDown = disco.ClusterStateDown
// NodeState represents the state of a node during startup.
nodeStateReady = "READY"
nodeStateDown = "DOWN"
// nodeStateDown represents the state of a node which is unavailable.
nodeStateDown = "DOWN"
// resizeJob states.
resizeJobStateRunning = "RUNNING"
@ -213,24 +212,6 @@ func (c *cluster) unprotectedIsCoordinator() bool {
return snap.PrimaryFieldTranslationNode().ID == c.Node.ID
}
// unprotectedSendSync is used in place of c.broadcaster.SendSync (which is
// Server.SendSync) because Server.SendSync needs to obtain a cluster lock to
// get the list of nodes. TODO: the reference loop from
// Server->cluster->broadcaster(Server) will likely continue to cause confusion
// and should be refactored.
func (c *cluster) unprotectedSendSync(m Message) error {
var eg errgroup.Group
for _, node := range c.noder.Nodes() {
node := node
// Don't send to myself.
if node.ID == c.Node.ID {
continue
}
eg.Go(func() error { return c.broadcaster.SendTo(node, m) })
}
return eg.Wait()
}
// addNode adds a node to the Cluster and updates and saves the
// new topology. unprotected.
func (c *cluster) addNode(node *topology.Node) error {

View file

@ -1823,6 +1823,11 @@ type holderCleaner struct {
Closing <-chan struct{}
}
// TODO: this is here to satisfy the linter since holderCleaner was removed from
// the gossip implementation of removeNode. But presumably we will use it once
// we have ported over the etcd implementation.
var _ holderCleaner
// IsClosing returns true if the cleaner has been marked to close.
func (c *holderCleaner) IsClosing() bool {
select {