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 connection pool discarding is_master flag on reset #534

Merged
merged 1 commit into from
Sep 18, 2014

Conversation

jonathanfrawley
Copy link

Problem:
When resetting a sentinel connection pool which is set to point at the slaves, it resets to point at the master every time as the is_master flag is not passed into the constructor on reset.

Solution:
Pass the is_master flag through on reset, which will attempt to reconnect to the master or slave depending on what the programmer originally asked for.

Risk:
No real risk here as the client will connect to the master if no slaves are available. The desired behaviour is that the connection pool retains the knowledge that it should be connected to a master or a slave. We have been using this change in production for 2 weeks with no problems.

 - is_master is not passed through when recreating the ConnectionPool.
 - This was causing unexpected behaviour where we would specifiy that we
   wish to connect to the slave, but the master would be read from
   instead.
@jonathanfrawley jonathanfrawley changed the title Passing is_master flag through on reset Sentinel connection pool discarding is_master flag on reset Sep 18, 2014
andymccurdy added a commit that referenced this pull request Sep 18, 2014
Sentinel connection pool discarding is_master flag on reset
@andymccurdy andymccurdy merged commit 0de78db into redis:master Sep 18, 2014
@andymccurdy
Copy link
Contributor

Thanks!

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