static TimeDuration getMaxRetrySleepTime(RatisConfig.Client config) {
    final int maxAttempts = config.getClientMaxRetryAttempt();
    final long baseSleepMs = config.getClientRetryInitialSleepTimeMs();
    final long maxSleepMs = config.getClientRetryMaxSleepTimeMs();
    final long timeoutMs = config.getClientRequestTimeoutMillis();

    long maxWaitMs = 0L;
    long currentSleepMs = baseSleepMs;
    for (int i = 0; i < maxAttempts; i++) {
      maxWaitMs += timeoutMs;
      maxWaitMs += currentSleepMs;
      currentSleepMs = Math.min(2 * currentSleepMs, maxSleepMs);
    }

    return TimeDuration.valueOf(maxWaitMs, TimeUnit.MILLISECONDS);
  }
return the max wait duration for retry
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/utils/Utils.java