Skip to content
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 preferredSlaves option #370

Merged
merged 3 commits into from
Sep 24, 2016
Merged

Sentinel preferredSlaves option #370

merged 3 commits into from
Sep 24, 2016

Conversation

doublesharp
Copy link
Contributor

Option to specify a preferred slave (or slaves by priority) when connecting to a Sentinel group.

Fixes #38 .

local reads in a distributed environment. Value can be an array of
objects with required properties “ip” and “port” and option property of
“prio” indicating the priority, defaults to 1, lower numbers preferred
first. If the value is a function the available slaves are passed into
it, expecting a single slave as the response. If no preferred slave is
found a random one is returned from those available.

Updated tests to return bad values in SENTINEL slaves command but still
select the correct one based on the preferredSlave result.
@luin luin merged commit 6ddcc99 into redis:master Sep 24, 2016
@luin
Copy link
Collaborator

luin commented Sep 24, 2016

Released with 2.4.0. Thank you for the pull request (and the documentation for the changes) :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants