-
Notifications
You must be signed in to change notification settings - Fork 219
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
Sentinel support #79
base: master
Are you sure you want to change the base?
Sentinel support #79
Conversation
@@ -146,6 +155,12 @@ private [redis] trait R extends Reply { | |||
case _ => Iterator.single(None) | |||
}.toList) | |||
|
|||
def asListOfListPairs[A,B](implicit parseA: Parse[A], parseB: Parse[B]): Option[List[Option[List[Option[(A,B)]]]]] = | |||
receive(multiMultiBulkReply).map(_.map(_.map(_.grouped(2).map { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new MapOverflowException :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, will probably need refactoring if it gets to ListOfListOfListPairs
.
Thanks for the PR. Will take a detailed look and merge. Apologies for the delay, awfully busy at this point in time :-( |
I am looking to use sentinel functionality if possible, does it look like this will be merged into the master anytime soon? |
Sorry .. very sorry .. I just didn't have time to look into it. Will have a look very soon and merge .. |
No problems, I can help test it after the merge as well. |
Merged sentinel support in branch scala-redis-sentinel https://github.com/debasishg/scala-redis/tree/scala-redis-sentinel .. You want to give it a spin. I ran using the bootstrap script sentinel.sh and found all tests running. |
Thank you! Will be checking it out today :) |
It seems to be working fine in my system! However, there is still a behavioural issue; when the master node fails for a RedisClientPool, there is a period of time in which a "ConnectException" is returned. One would expect this to roughly correspond to the failover configuration for the sentinel system, but this is not the case. For a failover time of 5 seconds, one needs to wait roughly 20 seconds before one can use the RedisClientPool again without a ConnectException being raised. (Then again, I might be misunderstanding something somewhere, and this might be the correct behaviour.) I'll try and take a look at it if I have the energy/time, but it's fairly low priority for me as everything else seems to be working fine. |
So this PR is dead? |
I did not merge this with master since there were breaking changes for the client. It was in a separate branch as I mentioned in a comment above. It was not tested much and I guess was not used much as well. I did some brief testing and found a few issues which need to be fixed. However I could not find time to pursue on this track any further. If there is really demand for using sentinel I can take this up seriously, though I am not sure about the time commitment. Still I would like to continue it as a separate branch. The effort required now is to backport the changes from master to this branch. As usual PRs are welcome, otherwise I will try to get this up and running in my spare time. |
I added a sentinel client, plus dynamic master address support for the normal clients. There's a tiny breaking API change, due to the default parameters on
RedisClientPool
and the fact that scala apparently only supports default parameters on the primary constructor.My bootstrap script to make testing easier: