-
Notifications
You must be signed in to change notification settings - Fork 35
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
Implement clustering, loop over machines until one works #39
Conversation
2 things that are obvious but not yet solved here are behaviour on redirects and a means of not breaking the API whilst introducing cluster support. |
@josephglanville i would love to add cluster awareness, but i am inclined to design it more like the go-etcd client, where a retry logic is exercised upon request failures. Users can pass their own/custom logic, in absence of which the client will fallback to a default retry logic. https://github.com/coreos/go-etcd/blob/master/etcd/requests.go#L291 |
@ranjib Yes this looks like a good approach. We could easily have a default block that is execute in the case of a connection error and allow the user to pass in their own method with something like Etcd.client(on_request_fail: &retry_logic) |
I think we can maintain compatibility it with the |
I'm also interested by this feature, is there something new about it? |
I haven't had time to approach this yet, I am using a naive implementation atm. |
This isn't quite the same thing, but I have spiked some code that will follow redirects. It fixed some issues I was having in a clustered environment: master...tpett:retryable It's not currently tested because I'm not sure how to reproduce it in the test environment otherwise I would create a pull request for it. |
In the case of a Now in the case of some transient network / server error Retriable would seem like a great option. What I was seeing was a server I had configured was no longer the leader and it was redirecting my update requests to the leader and the library wasn't handling the redirects for me. If you aren't opposed to the dependency, I would probably use something like Faraday. It is a wrapper over |
@tpett faraday is fine. in fact may be it will better, as faraday will allow lot more pluggable middlewares. i think i can use some of faraday's niceties on jruby as well :-) |
@ranjib yeah the middleware system is my favorite part of Faraday. And it looks like JRuby is officially supported in the readme! |
Hi all, has there been any progress on this? @ranjib, I was also wondering if you had considered adding support for DNS-based cluster discovery? I'd like to contribute either way if I can. |
@luispollo I am heavily engaged in golang based client for etcd/consul now, hence this library is lacking some love. I am happy to add @tpett of any of you as collaborator and setup necessary rubygem permission so that these issues can get addressed , |
Thanks @ranjib. I'm trying to determine what's the most efficient way to make progress. My goal is to have a production-grade etcd client that supports cluster discovery and automatic fail-over. Just out of curiosity, have you ever considered joining forces with iconara/etcd-rb? There hasn't been any activity there for a long time, but that client seemed to address some of the limitations we're talking about here. On the other hand, it lacked V2 API support, which your client has. Thoughts? |
@luispollo that is a very good idea. I'd love to hear his opinion, and contribute any way I can. |
Hi,
This is a first attempt at implementing some form of cluster support.
It's very naive at this point but I wanted to get this out there so we could collaborate on a better approach.