-
Notifications
You must be signed in to change notification settings - Fork 138
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
Redis sentinel failover #372
Comments
PRs are always welcome. tbh. I know very little about redis cluster/sentinel so I'm entirely dependent on contributions by the community. |
I was thinking this should be fairly easy .. but I am already running into an issue, currently the sentinel manager holds And that is where I got stuck; as far as I can see there is no method to retrieve the server ip/port from a multiplexedConnection. Another option I was thinking of is storing metadata for the connection in the Manager; eg: instead of Type being I might be able to use something like Do you know any better way to retrieve the ip/port of the connection (basically the connection_info that is used to create the connection)? |
Don't worry about backwards incompatibility. Every time the Changing the return type of the Manager is fine as it's already our own custom type with a Wrapper that implements the |
Ok I think I have a first draft of how to achieve this: master...ederuiter:deadpool:feature/sentinel-failover ^ I have introduced a At least this seems to work as it used to 🎉. Now I "only" need to implement the logic for the detecting whenever a failover occurs and tying that into the recycle logic. I will have a go at that over the weekend. |
I did some additional testing; but it seems that in order for this to work I still need some changes in redis-rs. |
This problem sounds an awful lot like... I also toyed with the idea of adding a kind of "revision" or "version" information to all objects so it is easy to discard them if the configuration and/or managed is changed. |
I was looking at implementing this: redis-rs/redis-rs#1438 but it looks like implementing this in
redis-rs
is not feasible atm (atleast for me) .So I was thinking that maybe I can easily add it here .. there is already logic for recycling connections; it would be easy enough to add a check if the redis server that the connection points to, is still a healthy master/replica according to the sentinels.
Would you be open to accept a PR adding this functionality?
The text was updated successfully, but these errors were encountered: