diff --git a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java index b616b694248b..b3cddf00493d 100644 --- a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java +++ b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java @@ -426,11 +426,11 @@ private RaftClientReply doRead( public void createLocalPeer(ConsensusGroupId groupId, List peers) throws ConsensusException { RaftGroup group = buildRaftGroup(groupId, peers); - RaftGroup clientGroup = - group.getPeers().isEmpty() ? RaftGroup.valueOf(group.getGroupId(), myself) : group; - try (RatisClient client = getRaftClient(clientGroup)) { + try { RaftClientReply reply = - client.getRaftClient().getGroupManagementApi(myself.getId()).add(group, true); + server.groupManagement( + GroupManagementRequest.newAdd( + localFakeId, myself.getId(), localFakeCallId.incrementAndGet(), group, true)); if (!reply.isSuccess()) { throw new RatisRequestFailedException(reply.getException()); }