If nodes of the cluster are not reachable clear the slots cache#2807
Conversation
…s are unreachable
d36c7d9 to
56fea7d
Compare
|
This seems reasonable to me. I guess the only downside is if we got into some pathological condition where we were getting lots of timeouts (extremely high volume or network issues), but flushing the cache and even building a new one is not particularly slow. |
|
@michael-grunder, I'm not sure if in this case we also need to call |
|
It seems reasonable to nuke the slot cache when we can't connect to any node. I'll play around with it locally this week. Remapping the keyspace isn't the end of the world. PhpRedis didn't even have slot caching for a few versions of |
|
Hi @michael-grunder , |
|
Merged, thanks! Sorry about the delay. |
During AWS ElastiCache(redis/valkey) upgrade their system builds completely different cluster(All new masters - Possibly swaps with slaves, we're not sure).
If slots cache is turned on - "Can't communicate with any node in the cluster" error happens with all requests unless PHP_FPM is fully restarted.
This change forces phpredis to issue a cache clear operation in such a case.