Skip to content

Commit

Permalink
fix: fix non-unique instance id in the node (#798)
Browse files Browse the repository at this point in the history
Signed-off-by: wangxye <xuanyewang.cs@gmail.com>
  • Loading branch information
wangxye committed Dec 5, 2023
1 parent a6bf037 commit 99c0fb7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,14 @@ public CompletableFuture<Node> registerBrokerNode(String name, String address, S
if (this.isLeader()) {
try (SqlSession session = openSession()) {
NodeMapper nodeMapper = session.getMapper(NodeMapper.class);
Node node = nodeMapper.get(null, name, instanceId, null);
Node node = nodeMapper.get(null, name, null, null);
if (null != node) {
if (!Strings.isNullOrEmpty(address)) {
node.setAddress(address);
}
if (!Strings.isNullOrEmpty(instanceId)) {
node.setInstanceId(instanceId);
}
node.setEpoch(node.getEpoch() + 1);
nodeMapper.update(node);
} else {
Expand Down

0 comments on commit 99c0fb7

Please sign in to comment.