This is an automated email from the ASF dual-hosted git repository.

tanxinyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 63605be3186 Fix the issue where ConfigNode reports 
'ConsensusGroupAlreadyExist' error during startup in some scenarios (#11928)
63605be3186 is described below

commit 63605be318693b73ca922272546967634dc7eb56
Author: Potato <[email protected]>
AuthorDate: Fri Jan 19 15:07:13 2024 +0800

    Fix the issue where ConfigNode reports 'ConsensusGroupAlreadyExist' error 
during startup in some scenarios (#11928)
    
    Signed-off-by: OneSizeFitQuorum <[email protected]>
---
 .../java/org/apache/iotdb/consensus/ratis/RatisConsensus.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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 b616b694248..b3cddf00493 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 @@ class RatisConsensus implements IConsensus {
   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());
       }

Reply via email to