Skip to content

Commit

Permalink
Fix the issue where ConfigNode reports 'ConsensusGroupAlreadyExist' e…
Browse files Browse the repository at this point in the history
…rror during startup in some scenarios (apache#11928)

Signed-off-by: OneSizeFitQuorum <tanxinyu@apache.org>
  • Loading branch information
OneSizeFitsQuorum authored and SzyWilliam committed Nov 22, 2024
1 parent 630eab4 commit f47dc83
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,11 @@ private RaftClientReply doRead(
public void createLocalPeer(ConsensusGroupId groupId, List<Peer> 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());
}
Expand Down

0 comments on commit f47dc83

Please sign in to comment.