diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/HdfsClientConfigKeys.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/HdfsClientConfigKeys.java index efc2766e9e3..ab3f6f27211 100755 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/HdfsClientConfigKeys.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/HdfsClientConfigKeys.java @@ -343,7 +343,7 @@ public interface HdfsClientConfigKeys { PREFIX + "connection.retries.on.timeouts"; int CONNECTION_RETRIES_ON_SOCKET_TIMEOUTS_DEFAULT = 0; String RANDOM_ORDER = PREFIX + "random.order"; - boolean RANDOM_ORDER_DEFAULT = false; + boolean RANDOM_ORDER_DEFAULT = true; String RESOLVE_ADDRESS_NEEDED_KEY = PREFIX + "resolve-needed"; boolean RESOLVE_ADDRESS_NEEDED_DEFAULT = false; String RESOLVE_SERVICE_KEY = PREFIX + "resolver.impl"; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml index 0dc279996ba..76b4a499c9a 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml @@ -4070,7 +4070,7 @@ dfs.client.failover.random.order - false + true Determines if the failover proxies are picked in random order instead of the configured order. Random order may be enabled for better load balancing diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestObserverReadProxyProvider.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestObserverReadProxyProvider.java index e23bb24ef56..630789b9eed 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestObserverReadProxyProvider.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestObserverReadProxyProvider.java @@ -78,6 +78,7 @@ public class TestObserverReadProxyProvider { // transition observer back and forth conf.setTimeDuration( OBSERVER_PROBE_RETRY_PERIOD_KEY, 0, TimeUnit.MILLISECONDS); + conf.setBoolean(HdfsClientConfigKeys.Failover.RANDOM_ORDER, false); } private void setupProxyProvider(int namenodeCount) throws Exception {