fix redis sentinel client handling to solve authentication error with password protected sentinel - #7718
fix redis sentinel client handling to solve authentication error with password protected sentinel#7718RndName wants to merge 2 commits into
Conversation
- sentinel_password is now passed to sentinel_kwargs correctly - added additional connection_kwargs as it was done with redis_cluster implementation - this allows users to set redis_password, sentinel_password and all other parameters as expected
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
i just spent a day trying to figure out why sentinel wasnt working with my setup as well, so thanks for this |
|
this is very helpful also for enterprise use cases and should be merged asap. |
|
The current implementation will cause an error ( To resolve this issue, we have two possible solutions:
sentinel_kwargs.pop('socket_timeout')or
return sentinel.master_for(service_name, **connection_kwargs)Either approach will prevent the duplication of the socket_timeout argument and avoid the related runtime error. |
|
|
|
This is very actual issue |
Title
Implement correct redis sentinel client handling to fix a bug with sentinel_password not working as intended (authentication error when sentinel is using requirepass) as no password would be used to authenticate against sentinel.
In the previous implementation sentinel_password was passed directly as "password" which will be used by sentinel as connection_kwargs to connect to the redis master and not for authentication of the sentinel node. For sentinel authentication the sentinel_kwargs dict will be used instead.
The fix adopts the implementation to match the redis-py documentation for the sentinel Client (https://redis-py.readthedocs.io/en/v5.0.0/connections.html#sentinel-client) and allows the user to set REDIS_PASSWORD and REDIS_SENTINEL_PASSWORD correctly. It is also possible now to handle situations where users use different passwords for redis and sentinel nodes.
Cite from the manual:
Relevant issues
#6154
Type
🐛 Bug Fix
Changes
[REQUIRED] Testing - Attach a screenshot of any new tests passing locally
Tested with a redis-sentinel cluster with 3 sentinels and 3 redis nodes in a kubernetes deployment