Merge pull request #499 from travisturner/default-local-node-to-up

set local node state to UP by default
This commit is contained in:
Travis Turner 2017-04-28 08:01:16 -05:00 • committed by GitHub
commit 38fbeb0b9f

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)
}