-
Notifications
You must be signed in to change notification settings - Fork 75
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
inconsistent names/paths in node creation after chroot #58
Comments
I think you may be a little confused about how zookeeper in general thinks about things. When you provide a prefix for sequential nodes to be created, you are giving a znode path, and the last element acts as a prefix for the nodes being created. (I use ZK for stuff like this, since it's a little nicer to work with.)
This is so you could have multiple different file-prefix-names under a given path (this is used in the shared locking implementation, with read/write locks using different prefixes). You created ephemeral sequential keys, which can't have children (if I'm reading you right, I think you were attempting to do that). Honestly, i've never used zookeeper like what you're describing. The use case for chroot, in my mind at least, was always isolating different environments or apps from one another, but not single paths. The use case I always imagined was:
('ns' just being some kind of namespacing root for the company, or signifying that this is where service discovery is going to happen) so for the app "dingus" running in staging, its cluster members working on frobbing widgets...
and when you started up the app, each frobber would do the following:
This would create an ephemeral sequential path under the global root like TBH it all depends on what you're trying to do with zk. |
i was pointing out was that omitting the prefix before creating a sequential node doesn't work. in fact, even a single-character prefix does not work. in other words:
should create a node like i tested this only when chrooted; perhaps the path
i end up with node |
I'm not sure :/ I'm going to be on vacation for the next week, so I won't have time to look Can you use a prefix with more than one character as a workaround in the On Tue, Feb 11, 2014 at 6:41 PM, Igor Serebryany
|
here's what i'm trying:
before i start, here is the state in zkCli:
i expect that after i'm done, i should contain a state like this:
in other words, because I chrooted, i should have all my nodes created under
/test/service
and the characters i put into the:path
argument should be pre-pended to the sequential key name.instead, here is what i get:
none of my nodes got created under
/test/service
; additionally, if i just use a single character as a path, that character disappears (likea
andb
but notbc
).on the other hand, if i set a path like
/a
, then i get the right behavior, with a node under/test/service
calleda00000000001
.am i doing something wrong? i reported a this bug also under zk-ruby/zk#77 but maybe it belongs even further upstream?
The text was updated successfully, but these errors were encountered: