-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Can not use a specified DB with NewFailoverClusterClient. suggested possible fix #2824
Comments
Any updates ? @SoulPancake @ofekshenawa can anyone of you or other contributors can lookinto this ? |
Any updates regarding this? @Ankit-Kulkarni do you change the file urself in local for temp fix? |
@rosaekapratama yes the above code patch worked for me . i have changed it to local and using it since then. |
Good day, Thank you for posting this @Ankit-Kulkarni . Was stumbling on this myself on an application I use. Best |
Thanks folks and sorry to miss this Hi @monkey92t |
Thanks @SoulPancake |
If you create a redis client using sentinel failover options but you have to use a different db than 0 and route your read only queries to slaves , different db number is not honoured.
Library version I used: v8.11.5
Expected Behavior
We would expect the
NewFailoverClusterClient
to honor the DB mentioned in FailoverOptions.Currently I am using
redis.FailoverOptions
to create a*redis.ClusterClient
usingNewFailoverClusterClient
. I wanted to route read only queries to slaves and hence usingNewFailoverClusterClient
instead ofNewFailoverClient
. My failover configuration has a DB say5
but when i use*redis.ClusterClient
it does all operations on db 0 only. Reference code belowAbove rdsClient when doing set or get will work only on db:0 and not db:5
Possible Solution
I think the issue is because the
ClusterOptions
struct doesn't support DB(may be intentional but i couldn't figure out why). I tried quick local modification to library for below structs and functions and it seemed to work. But not sure if this change misses/breaks anything else (specifically if this was unintentional)The text was updated successfully, but these errors were encountered: