Skip to content
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

GetNextId in ZK component throw zk: node does not exist #747

Closed
zhenjunMa opened this issue Jul 30, 2022 · 2 comments · Fixed by #752
Closed

GetNextId in ZK component throw zk: node does not exist #747

zhenjunMa opened this issue Jul 30, 2022 · 2 comments · Fixed by #752
Labels
good first issue Good for newcomers help wanted Extra attention is needed kind/bug

Comments

@zhenjunMa
Copy link
Contributor

What happened:

when I call GetNextId API in layotto that use zookeeper as its component, I got an error, zk: node does not exist, as below:

image

What you expected to happen:

Get a unique ID

How to reproduce it (as minimally and precisely as possible):

  1. start a zookeeper server, maybe use docker
  2. start layotto server, maybe execute this command: ./layotto start -c configs/config_zookeeper.json
  3. start a client to call GetNextId, maybe as follows:
cli, err := client.NewClientWithAddress("127.0.0.1:34904")
resp, err := cli.GetNextId(ctx, &runtimev1pb.GetNextIdRequest{
	StoreName: "sequencer_demo",
	Key:       sequencerKey,
})

Anything else we need to know?:

image

solution A:
we can add a method createOrUpdate to implement the logic that create a zk node when it doesn't exist or update it directly.

solution B:
add a method isExist to check if the request node has been created

@zhenjunMa zhenjunMa added good first issue Good for newcomers help wanted Extra attention is needed kind/bug labels Jul 30, 2022
@bxiiiiii
Copy link
Contributor

方法的实现在这个文件里面进行吗
1659168170743

@zhenjunMa
Copy link
Contributor Author

@bxiiiiii 不能在这里加,不然别人用不了,一个是你在我上面那个接口里面加,一个是你可以在GetNextId的实现里面不直接Set 而是先判断一下是否存在再set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed kind/bug
Projects
None yet
2 participants