-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Failover option, closes #821, closes #830, closes #831 #895
Conversation
@epoberezkin I'm really busy at the moment and could not do a review yet. I'll try to do a review this weekend. Thx for your work so far :) |
Thank you for the reply, no problem. I will be fixing the failing tests over the weekend. The review would be great. Maybe you can give me the advice what is the best environment to run the tests? Because I do it on mac and although I disable lots of things (ipv6, hiredis) I still have plenty of tests failing (even without my changes)... |
@epoberezkin I'm uncertain why the tests fail for you on mac. What node.js version do you use? They definitly work on linux properly and @paddybyers ran the tests on mac too. |
@epoberezkin which tests are failing? I had quite a few failures, especially relating to unix socket connection, because I had a redis process already running. When that was killed and the tests started redis for themselves, with the correct permissions on |
@paddybyers @BridgeAR redis definitely wasn't running but that's embarrassing really - now all the tests (without my changes yet) pass. It seems that updating redis wasn't enough - it also needed restart. I suspect that the changes I was making to make it work with older version (like removing ipv6, hiredis etc.) were preventing the newer one from working correctly... Thank you, now I can fix my changes. |
@BridgeAR seems like it is all working now, at least in travis... When you have some time to have a look please let me know what needs to be changed. @paddybyers thanks for the hint - the wrong socket path used for the second instance of redis was the main issue. |
Not sure why windows tests are failing... It seems like they were failing for 2.2.5 too. |
@epoberezkin the tests worked in windows too. There might still be a flaky test but it's only about one out of 10 builds that fail (like here). |
@BridgeAR the problem seems to be that it's not easy to determine in windows whether the redis has started. So the main instance is just assumed to have been started and both auth and rename tests are just skipped in windows. I guess I should just skip failover tests in windows too... |
@epoberezkin sounds ok for now. @bcoe do you think you might find the time to get more tests to work on windows? :) |
@BridgeAR now it passes tests in most windows jobs: https://ci.appveyor.com/project/bcoe/node-redis/build/292 |
OS: Default Azure; Environment: nodejs_version=0.12 - only one test failed |
@BridgeAR I have merged master branch. All the windows tests pass apart from one test in connection.spec.js in the job "OS: Windows Server 2012 R2; Environment: nodejs_version=0.10" Could you please merge it? |
I'll look through everything later on. Right now I'm abroad and am only rarely on the computer. |
Thank you, no problem |
@BridgeAR hi. How are we doing with this PR? I hope you can look at it some time this week :) |
+1 for merge |
I had a glimpse but this is a significant change and I do not find the time to fully review this atm :( If anyone has the time to do a review, I'd really appreciate the help. @NodeRedis/contributors @lsde |
@BridgeAR Thanks for pushing it. It's not a very small change indeed. On the other hand most of the changes are isolated and most of the added lines are additional tests - I've kept the changes to the core of the driver as minimal as possible. |
First off: I'm not using node_redis that much myself, but I used it once in a while on smaller projects. I also talked with @BridgeAR about some improvements and about this PR as well. I'm not convinced your changes belong into the core of node_redis. |
@badboy Thanks for the reply. I've done this PR as the result of the discussion in another PR: #831. Could you please read it? The problem solved there (changing/enabling redis passwords #821) is not addressed in Sentinel or anywhere else and it can't be fully covered by error-handling function, as @BridgeAR wrote there. After I've done #831, that was much simpler and smaller change, @BridgeAR specifically said that his preference is a more generic failover option, that is in this PR. I don't mind either approaches as long as the original problem can be addressed in some way. This PR also resolves issue #830. Having a failover mechanism in the library can be preferable to many users - it may be easier to manage. But I don't mind going back to the original PR, it solves my problems too... I look forward to some progress here :) |
+1 |
@tombburnell just run the auth command with the upcoming password. The password is going to be saved in the client and when you switch restart the redis servers with the new config and password the auth command is going to be fired with the saved password and is therefor able to connect without further downtime. |
@BridgeAR This implements all the discussed features within failover option:
4 Supporting multiple passwords per host so that when the password is changed and the driver reconnects the connection is successful (Handle enabling/changing redis password without application restart #821)
It includes all the functionality from #831
After the last merge from the upstream I have difficulties running tests locally, I expect the tests to fail for this PR - will be fixing them.
Help is appreciated :)