state: add HA health prober
Ping HA subnet routers each probe cycle and mark unresponsive nodes unhealthy. Reconnecting a node clears its unhealthy state since the fresh Noise session proves basic connectivity. Updates #2129 Updates #2902
This commit is contained in:
parent
786ce2dce8
commit
90e65ccd63
3 changed files with 203 additions and 0 deletions
|
|
@ -574,6 +574,10 @@ func (s *State) Connect(id types.NodeID) ([]change.Change, uint64) {
|
|||
|
||||
log.Info().EmbedObject(node).Msg("node connected")
|
||||
|
||||
// Reconnecting clears any prior unhealthy state — the node proved
|
||||
// basic connectivity by establishing the Noise session.
|
||||
s.primaryRoutes.ClearUnhealthy(id)
|
||||
|
||||
// Use the node's current routes for primary route update.
|
||||
// AllApprovedRoutes() returns only the intersection of announced and approved routes.
|
||||
routeChange := s.primaryRoutes.SetRoutes(id, node.AllApprovedRoutes()...)
|
||||
|
|
@ -1184,6 +1188,11 @@ func (s *State) RoutesForPeer(
|
|||
return reduced
|
||||
}
|
||||
|
||||
// PrimaryRoutes returns the primary routes tracker.
|
||||
func (s *State) PrimaryRoutes() *routes.PrimaryRoutes {
|
||||
return s.primaryRoutes
|
||||
}
|
||||
|
||||
// PrimaryRoutesString returns a string representation of all primary routes.
|
||||
func (s *State) PrimaryRoutesString() string {
|
||||
return s.primaryRoutes.String()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue