-
Notifications
You must be signed in to change notification settings - Fork 23
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 redis-sentinel #95
Conversation
Does anyone have a suggestion how it would be possible to test this automatically? I don't really have much experience with testing, but would be willing to work my way into it. |
Hello, @acteru! Sorry for late response. IIRC similar module for redis is tested by e2e tests with actual redis, so in this case we will need actual sentinel cluster in test env. It's doable, but quite laborious and not a priority because feature is quite isolated from other code and can be tested at least manually. Anyway, tests can be added later: feature with no tests is better than absence of feature. About things that forgotten and possible corner cases. I'm not sure application will handle properly election of new master server by sentinel. Code stores connection pool for master once and very likely it will not be valid if master was switched to another server (e.g. if old server just become unavailable). Unfortunately, I don't know how to approach this properly: store once as it is already done, or evaluate before each interaction with redis or reevaluate it once in a while (regularly or using some caching decorator with small time to live). I haven't much of experience with sentinel and python redis driver. If possible please check how it behaves after master switch. I have a feeling it can be improved in follow up pull requests. All in all, great job! Thank you for the contribution! |
@acteru |
@Snawoot What I was able to find out so far is that the sentinel client supports a reconnect. I get an error that the current master cannot be found, but after the master selection everything works again. For testing I did a manual failover, as long as the master is not available I get the following error and the stacktrace |
@acteru I think it's already good enough. Will make a new release as soon as I can. |
Released in v1.2.0 |
Purpose of proposed changes
Closes #94
Essential steps taken