mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
set local node state to UP by default
This commit is contained in:
parent
42405cecbf
commit
28cbc621c2
1 changed files with 8 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue