fix: ProtectedEphemeralSequential in the wrong zk path#849
Merged
peterbourgon merged 1 commit intogo-kit:masterfrom Apr 7, 2019
RedDragonet:patch-1
Merged
fix: ProtectedEphemeralSequential in the wrong zk path#849peterbourgon merged 1 commit intogo-kit:masterfrom RedDragonet:patch-1
ProtectedEphemeralSequential in the wrong zk path#849peterbourgon merged 1 commit intogo-kit:masterfrom
RedDragonet:patch-1
Conversation
```golang
register := zk.NewRegistrar(client,zk.Service{
Path: "/services/hello",
Name: "abc",
Data: []byte("http://127.0.0.1:8080"),
},logger)
```
> It will be created in zk
```sh
[zk: localhost:2181(CONNECTED) 161] ls /services/hello
[_c_c83db041ac654566228b72cbd541bcb5-abc0000000006, abc]
```
**/services/hello/_c_c83db041ac654566228b72cbd541bcb5** is correct
**/services/hello/abc** is empty node
```golang
//will get 0 instance
zk.NewInstancer(client,"/services/hello/abc",logger)
//will get 2 instances, one of them is <nil>
zk.NewInstancer(client,"/services/hello",logger)
```
In my understanding, [CreateProtectedEphemeralSequential](https://github.com/go-kit/kit/blob/master/sd/zk/client.go#L241) function will be created under `/services/hello/abc`
So is this a bug? Or there's something wrong with my usage?
Member
|
@basvanbeek Opinions? |
Contributor
Author
|
@peterbourgon Any suggestions? |
Member
|
I don't have enough knowledge about ZooKeeper to give any opinion here. |
Member
|
I guess it's fine? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/services/hello/_c_c83db041ac654566228b72cbd541bcb5 is correct
/services/hello/abc is empty node
In my understanding, CreateProtectedEphemeralSequential function will be created under
/services/hello/abcSo is this a bug? Or there's something wrong with my usage?