redis / rueidis

A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, etc.
Apache License 2.0
2.47k stars 158 forks source link

fix: do not pick failed cluster nodes while refreshing topology #660

Closed rueian closed 3 weeks ago

rueian commented 3 weeks ago

Previously, rueidis may pick a failed node as the primary node of a shard, especially if the failed node doesn't come back online. This PR skips those failed nodes and only picks nodes labeled as healthy as primaries.

Related to https://github.com/redis/rueidis/issues/658 and https://github.com/redis/rueidis/issues/384#issuecomment-2452676261