Description
We use redis ring client to shard access to redis for our rate limit infrastructure in Kubernetes https://opensource.zalando.com/skipper/tutorials/ratelimit/#redis-based-cluster-ratelimits.
I would like to add and remove shards on demand while Kubernetes is scaling-out redis instances.
I tried to implement it by closing and recreating the redis ring, but I think it would be better (less locks required) to trigger it via a library call.
One idea I had was to have a func() []string
that is called every configurable time.Duration with a time.Ticker to set the Members and propagate these into the library ringShards. Or we could also do the triggering ourselves and the library just provides ReconfigureShards(shards []string)
.
Do you have a better idea how to make this happen?
I am willing to create a PR if it makes sense for you.
Activity
vmihailenco commentedon May 21, 2022
@szuecs I think that providing API like
ring.SetAddrs(addrs map[string]string)
is a better way forward and I would gladly review such a PR 👍szuecs commentedon Aug 1, 2022
@vmihailenco can you check the updated PR?
Thanks!
szuecs commentedon Oct 6, 2022
I think we can close this one
ring: reduce SetAddrs shards lock contention
test: add TestRingSetAddrsContention
fix: reduce `SetAddrs` shards lock contention
fix: reduce `SetAddrs` shards lock contention
SetAddrs
shards lock contention #2292fix: reduce `SetAddrs` shards lock contention
net: update go-redis client
net: update go-redis client
net: update go-redis client
net: update go-redis client
net: update go-redis client
net: update go-redis client
net: update go-redis client (#2159)