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

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


The following commit(s) were added to refs/heads/ca_test by this push:
     new ba778c6a864 fix ratis remove peer not detected correctly by ConfigNode
ba778c6a864 is described below

commit ba778c6a8642aed8d616472e2d0f4b53bd76c78e
Author: Jinrui.Zhang <[email protected]>
AuthorDate: Wed Aug 16 14:49:52 2023 +0800

    fix ratis remove peer not detected correctly by ConfigNode
---
 .../main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 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 27c8bb0d271..600eead4cac 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
@@ -48,7 +48,6 @@ import 
org.apache.iotdb.consensus.exception.ConsensusException;
 import org.apache.iotdb.consensus.exception.ConsensusGroupNotExistException;
 import org.apache.iotdb.consensus.exception.NodeReadOnlyException;
 import 
org.apache.iotdb.consensus.exception.PeerAlreadyInConsensusGroupException;
-import org.apache.iotdb.consensus.exception.PeerNotInConsensusGroupException;
 import org.apache.iotdb.consensus.exception.RatisRequestFailedException;
 import org.apache.iotdb.consensus.exception.RatisUnderRecoveryException;
 import org.apache.iotdb.consensus.ratis.metrics.RatisMetricSet;
@@ -497,7 +496,9 @@ class RatisConsensus implements IConsensus {
     }
     // pre-condition: peer is a member of groupId
     if (!group.getPeers().contains(peerToRemove)) {
-      return failed(new PeerNotInConsensusGroupException(groupId, myself));
+      logger.error("duplicated peer remove operation detected. {}-{}", 
groupId, peer);
+      return ConsensusGenericResponse.newBuilder().setSuccess(true).build();
+      //      return failed(new PeerNotInConsensusGroupException(groupId, 
myself));
     }
 
     // update group peer information

Reply via email to