diff --git a/pkg/salud/salud.go b/pkg/salud/salud.go index 397362499b4..64826eee555 100644 --- a/pkg/salud/salud.go +++ b/pkg/salud/salud.go @@ -220,12 +220,10 @@ func (s *service) salud(mode string, minPeersPerbin int, durPercentile float64, } } - networkRadiusEstimation := s.reserve.StorageRadius() + s.capacityDoubling - selfHealth := true - if nHoodRadius == networkRadius && networkRadiusEstimation != networkRadius { + if nHoodRadius == networkRadius && s.reserve.StorageRadius() < networkRadius-1 { selfHealth = false - s.logger.Warning("node is unhealthy due to storage radius discrepancy", "self_radius", networkRadiusEstimation, "network_radius", networkRadius) + s.logger.Warning("node is unhealthy due to storage radius discrepancy", "self_radius", s.reserve.StorageRadius(), "network_radius", networkRadius) } s.isSelfHealthy.Store(selfHealth) diff --git a/pkg/salud/salud_test.go b/pkg/salud/salud_test.go index 5fc4dda733d..aaab2b27e37 100644 --- a/pkg/salud/salud_test.go +++ b/pkg/salud/salud_test.go @@ -112,7 +112,7 @@ func TestSelfUnhealthyRadius(t *testing.T) { topM := topMock.NewTopologyDriver(topMock.WithPeers(addrs...)) reserve := mockstorer.NewReserve( - mockstorer.WithRadius(7), + mockstorer.WithRadius(6), mockstorer.WithReserveSize(100), ) @@ -149,7 +149,7 @@ func TestSelfHealthyCapacityDoubling(t *testing.T) { topM := topMock.NewTopologyDriver(topMock.WithPeers(addrs...)) reserve := mockstorer.NewReserve( - mockstorer.WithRadius(6), + mockstorer.WithRadius(7), mockstorer.WithReserveSize(100), )