Skip to content

add/remove shards in redis ring #2077

Closed
@szuecs

Description

@szuecs
Contributor

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

vmihailenco commented on May 21, 2022

@vmihailenco
Collaborator

@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

szuecs commented on Aug 1, 2022

@szuecs
ContributorAuthor

@vmihailenco can you check the updated PR?
Thanks!

szuecs

szuecs commented on Oct 6, 2022

@szuecs
ContributorAuthor

I think we can close this one

added a commit that references this issue on Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @szuecs@vmihailenco

      Issue actions

        add/remove shards in redis ring · Issue #2077 · redis/go-redis