OneSizeFitsQuorum commented on code in PR #13178:
URL: https://github.com/apache/iotdb/pull/13178#discussion_r1721199870
##########
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java:
##########
@@ -864,14 +868,30 @@ private RatisClient getRaftClient(RaftGroup group) throws
ClientManagerException
}
}
+ private RatisClient getConfigurationRaftClient(RaftGroup group) throws
ClientManagerException {
+ try {
+ return reconfigurationClientManager.borrowClient(group);
+ } catch (ClientManagerException e) {
+ logger.error("Borrow client from pool for group {} failed.", group, e);
+ // rethrow the exception
+ throw e;
+ }
+ }
+
private RaftClientReply sendReconfiguration(RaftGroup newGroupConf)
throws RatisRequestFailedException {
// 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()) {
+ try (RatisClient client = getConfigurationRaftClient(newGroupConf)) {
+ while (true) {
Review Comment:
do we need this while(true) now? as we have already done endless retry in
raftclient
--
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]