mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-25 04:33:03 +00:00
fix: resolve 'no healthy nodes available' storage error (addresses #405)
- Changed cluster client initialization to be optimistic (assume healthy) - Nodes now start as healthy and are marked unhealthy only on actual failures - This prevents the issue where all nodes were marked unhealthy during init - Storage operations can now proceed even if initial health checks fail - Allows recovery from temporary network or auth issues during startup
This commit is contained in:
@@ -36,12 +36,14 @@ func NewClusterClient(name string, config ClientConfig, endpoints []string) *Clu
|
||||
}
|
||||
|
||||
// Initialize all endpoints as unknown (will be tested on first use)
|
||||
// Don't assume they're healthy until proven
|
||||
// Start optimistically - assume healthy until proven otherwise
|
||||
// This allows operations to be attempted even if initial health check fails
|
||||
for _, endpoint := range endpoints {
|
||||
cc.nodeHealth[endpoint] = false // Start pessimistic, will test immediately
|
||||
cc.nodeHealth[endpoint] = true // Start optimistic, will be marked unhealthy if operations fail
|
||||
}
|
||||
|
||||
// Do a quick parallel health check on initialization (synchronous to avoid race)
|
||||
// This will mark unhealthy nodes but won't prevent trying them later
|
||||
cc.initialHealthCheck()
|
||||
|
||||
return cc
|
||||
|
||||
Reference in New Issue
Block a user