From f207e301423a196d504540ebe780b371e820661b Mon Sep 17 00:00:00 2001 From: Mukul Kumar Singh Date: Thu, 22 Nov 2018 10:45:32 +0530 Subject: [PATCH] HDDS-814. dfs.ratis.leader.election.minimum.timeout.duration should not be read by client. Contributed by chencan. --- .../java/org/apache/ratis/RatisHelper.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/hadoop-hdds/common/src/main/java/org/apache/ratis/RatisHelper.java b/hadoop-hdds/common/src/main/java/org/apache/ratis/RatisHelper.java index 7e454d60ec3..e55dc5be840 100644 --- a/hadoop-hdds/common/src/main/java/org/apache/ratis/RatisHelper.java +++ b/hadoop-hdds/common/src/main/java/org/apache/ratis/RatisHelper.java @@ -35,7 +35,6 @@ import org.apache.ratis.retry.RetryPolicy; import org.apache.ratis.rpc.RpcType; import org.apache.ratis.thirdparty.com.google.protobuf.ByteString; import org.apache.ratis.proto.RaftProtos; -import org.apache.ratis.util.Preconditions; import org.apache.ratis.util.SizeInBytes; import org.apache.ratis.util.TimeDuration; import org.slf4j.Logger; @@ -51,9 +50,6 @@ import java.util.UUID; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_RATIS_LEADER_ELECTION_MINIMUM_TIMEOUT_DURATION_DEFAULT; -import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_RATIS_LEADER_ELECTION_MINIMUM_TIMEOUT_DURATION_KEY; - /** * Ratis helper methods. */ @@ -175,31 +171,6 @@ public interface RatisHelper { DFS_RATIS_CLIENT_REQUEST_RETRY_INTERVAL_KEY, OzoneConfigKeys. DFS_RATIS_CLIENT_REQUEST_RETRY_INTERVAL_DEFAULT .toInt(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS); - long leaderElectionTimeout = conf.getTimeDuration( - DFS_RATIS_LEADER_ELECTION_MINIMUM_TIMEOUT_DURATION_KEY, - DFS_RATIS_LEADER_ELECTION_MINIMUM_TIMEOUT_DURATION_DEFAULT - .toInt(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS); - long clientRequestTimeout = conf.getTimeDuration( - OzoneConfigKeys.DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_KEY, - OzoneConfigKeys.DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_DEFAULT - .toInt(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS); - long retryCacheTimeout = conf.getTimeDuration( - OzoneConfigKeys.DFS_RATIS_SERVER_RETRY_CACHE_TIMEOUT_DURATION_KEY, - OzoneConfigKeys.DFS_RATIS_SERVER_RETRY_CACHE_TIMEOUT_DURATION_DEFAULT - .toInt(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS); - Preconditions - .assertTrue(maxRetryCount * retryInterval > 5 * leaderElectionTimeout, - "Please make sure dfs.ratis.client.request.max.retries * " - + "dfs.ratis.client.request.retry.interval > " - + "5 * dfs.ratis.leader.election.minimum.timeout.duration"); - Preconditions.assertTrue( - maxRetryCount * (retryInterval + clientRequestTimeout) - < retryCacheTimeout, - "Please make sure " - + "(dfs.ratis.client.request.max.retries * " - + "(dfs.ratis.client.request.retry.interval + " - + "dfs.ratis.client.request.timeout.duration)) " - + "< dfs.ratis.server.retry-cache.timeout.duration"); TimeDuration sleepDuration = TimeDuration.valueOf(retryInterval, TimeUnit.MILLISECONDS); RetryPolicy retryPolicy = RetryPolicies