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

容器场景批量重启会造成服务器节点错删 #2394

Open
ExploreHeart opened this issue May 29, 2024 · 2 comments
Open

容器场景批量重启会造成服务器节点错删 #2394

ExploreHeart opened this issue May 29, 2024 · 2 comments

Comments

@ExploreHeart
Copy link

Collection<String> instanceIps = instances.stream().map(instance -> instance.split("@-@")[0]).collect(Collectors.toSet());

当前逻辑是先插入服务器节点,再插入实例节点,这两个操作不是事务的;当SDK在重启的时候:

  1. A客户端先拿到zk上的实例节点
  2. B客户端插入了服务器节点
  3. A客户端获取zk上的服务器节点
  4. A客户端拿到的实例节点中不存在B客户端的实例IP,导致后续遍历删除时,会删除B客户端的服务器节点。

能否把SetUpFacade#registerStartUpInfo方法中插入服务器节点和实例节点做出事务操作?

@songxiaosheng
Copy link
Member

感觉容器环境未来直接移除持久节点的使用会好点

@linghengqian
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants