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.34k stars 149 forks source link

enhancement: mitigate refresh storm #589

Closed proost closed 1 month ago

proost commented 1 month ago

what i found is when got "MOVED" to specific slot, many refreshes are possible. so we update "pslots" and "rslots" when got "MOVED".

"ASK" also triggers many refreshes but it should not change "pslots" and "rslots". because importing node may not serve some items which are migrated yet.

rueian commented 1 month ago

Cool! Thanks @proost! This looks good to me. I think we can merge it. However, I should remind you that this enhancement may be hard to trigger. It updates only ONE slot and only when a new node is added.

proost commented 1 month ago

@rueian Yes, i agree. This situation is very unlikely happen.