set local node state to UP by default

This commit is contained in:
Travis 2017-04-27 12:29:27 -05:00
parent 42405cecbf
commit 28cbc621c2
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9

View file

@ -320,6 +320,14 @@ func (s *Server) ClusterStatus() (proto.Message, error) {
// Update NodeState for all nodes.
for host, nodeState := range s.Cluster.NodeStates() {
// In a default configuration (or single-node) where a StaticNodeSet is used
// then all nodes are marked as DOWN. At the very least, we should consider
// the local node as UP.
// TODO: we should be able to remove this check if/when cluster.Nodes and
// cluster.NodeSet are unified.
if host == s.Host {
nodeState = NodeStateUp
}
node := s.Cluster.NodeByHost(host)
node.SetState(nodeState)
}