-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for reading from replicas in non-CLUSTER
environments
#8
Comments
I can't remember if this is a thing with Redis, but we may also need to adjust to network topology after we connect in case we don't have all the IP addresses or servers are added/removed after we connect, etc. This is common with a lot of clustered resources, but I don't know if Redis provides this information to clients. |
Cluster support is added in ca206a7 but it doesn't handle plain replication (single primary shard, many replicas). Redis doesn't call this "clustering" and none of the And, realistically speaking, do Redis clusters exist in the wild that do simple replication without cluster-mode enabled? I'm still also unsure that the current abstraction split between |
Just wanted to add to this. Our redis env is using cluster mode. stefanwille/crystal-redis#127 There's a docker-compose example in this issue that could be used for some local testing on this. |
@jwoertink Thanks for jumping in here. If I’m reading that issue correctly[1], this shard already supports that particular type of Redis clustering. This issue is still open only to handle the plain-old-replication form of clustering (via If you use this shard on your Redis cluster (using cluster = Redis::Cluster.new(REDIS_URL)
pp cluster.lrange(“thing”, “0”, “-1”) (pardon the smart quotes in that code, I’m writing on an iPad) [1] The |
oh nice! I'll have to give that a shot and let you know how it goes. That's for the info 🚀 |
CLUSTER
environments
I think we can handle this by accepting a list of
URI
s inClient#initialize
and assigning them at random in the connection pool block.Thinking something like this:
The text was updated successfully, but these errors were encountered: