From 28cbc621c2aec860ed6782ad5b69b155649d0eb2 Mon Sep 17 00:00:00 2001 From: Travis Date: Thu, 27 Apr 2017 12:29:27 -0500 Subject: [PATCH] set local node state to UP by default --- server.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server.go b/server.go index 60d60b3ea..3b4c1a87f 100644 --- a/server.go +++ b/server.go @@ -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) }