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
Zookeeper driver support #132
Conversation
@fanatic : great!!! Love it! Let me have a look at it and get back to you soon (we need to get 0.3 released first, but this will definitely make it for 0.4). About skipping the tests (on environments where we don't have / want a zookeeper service), have a look at how it's done for etcd:
Thanks! |
Also: can you run |
Thanks for the encouragement (this is my first pull request)! I'll clean it up -- thanks for your feedback. |
I'd still like to refactor some of the get-then-set methods to respect versioning for atomic changes. @dmp42 do you have any suggestions for cleaning up the entries in zookeeper that the unit tests add? I've been cleaning them up by hand after each run. Zookeeper 14 passing (3s) |
@fanatic I guess zookeeper can be launched (by our fixtures script) specifying command line arguments and/or a custom config file. That config file would then point the zookeeper dataDir to a specific folder (say: What do you think? |
Sounds like a plan. I was starting the server like this: And using this config:
|
I have the hope that zkServer is just a (very? simple?) wrapper that ultimately does something in the line of: Given this is for the purpose of running tests available to developers only, I don't quite care if our launcher is not "very" portable. So, if you can find a hack, or even commit a copy of zkServer.sh in our fixtures, I'd be ok with that. And yes, commit the tests' config file as well. |
@@ -3,7 +3,7 @@ node_js: | |||
- "0.10" | |||
|
|||
env: | |||
- NO_ETCD=true | |||
- NO_ETCD=true NO_ZOOKEEPER=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One on each line might be more readable?
Anyhow, thinking more about this: it might very well be possible to ask travis to install zookeeper (look at the other apt-get install we do) and have the tests run on it.
Can you have a look at this?
Ok, I only have some minor nitpicks on this (see inline), mainly:
Apart from that, I'm a bit worried about performance right now - domains.with.lots.of.subdomains will generate lots of queries to ZK. Any idea how fast it is at that? |
Apologies for the delay. I believe I've addressed your concerns to the best of my abilities. I'm forced to drop the configuration file as ZK expects it to exist on disk, and I clean up the data directory during 'stop'. ZK performance has always been respectable in my experience. On our 5 node cluster, we regularly reach 500k op/s with various applications with latency under 1ms, but I'm happy to make improvements if you have some suggestions. |
Hi @fanatic No problem for the delay - I was and am busy as well. I like what you did quite a lot. Can you rebase it on top of master? |
LGTM |
Would be happy to merge this once rebased / reviewed again (cc @willdurand) |
see: #186
|
Zookeeper driver support (replaces #132)
Adds a zookeeper driver that matches conventions used in the etcd, memcached, and redis libraries. All tests pass.
Note that unit tests require zookeeper server to be started by hand on :2182 so this may not be able to be merged until it can be modified to be skipped.
Also, I don't yet clean up dead backends after the ttls have expired, I just check the ttl on read. A future iteration should remove znodes in the dead path.