133tosakarin commented on code in PR #13178:
URL: https://github.com/apache/iotdb/pull/13178#discussion_r1718208592


##########
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java:
##########
@@ -869,9 +873,34 @@ private RaftClientReply sendReconfiguration(RaftGroup 
newGroupConf)
     // notify the group leader of configuration change
     RaftClientReply reply;
     try (RatisClient client = getRaftClient(newGroupConf)) {
-      reply =
-          client.getRaftClient().admin().setConfiguration(new 
ArrayList<>(newGroupConf.getPeers()));
-      if (!reply.isSuccess()) {
+      int basicWaitTime = 500;
+      int maxWaitTime = 10000;
+      int retryTimes = 0;
+      while (true) {
+        logger.info("retry sendConfiguration req {} times", retryTimes);
+        reply =
+            client
+                .getRaftClient()
+                .admin()
+                .setConfiguration(new ArrayList<>(newGroupConf.getPeers()));
+        if (reply.isSuccess()) {
+          logger.info("reConfiguration success");
+          break;
+        }
+        if (reply.getException() instanceof ReconfigurationInProgressException
+            || reply.getException() instanceof LeaderSteppingDownException

Review Comment:
   it will loop until reply return success or throw other exception.  In fact, 
I want to use RaftServer.LifeCycle as loop factor,  if majority 
RaftServer.LifeCycle is RUNNING, then we can return, but I can't get 
raftServers in newGroupConf's peers



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to