You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by jh...@apache.org on 2018/03/22 20:43:10 UTC
[24/50] [abbrv] hadoop git commit: HDFS-11014: libhdfs++: Make
connection to HA clusters faster. Contributed by James Clampffer.
HDFS-11014: libhdfs++: Make connection to HA clusters faster. Contributed by James Clampffer.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/062d8cd2
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/062d8cd2
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/062d8cd2
Branch: refs/heads/HDFS-8707
Commit: 062d8cd2ec3a731fc73480ed9532d319cebb3a84
Parents: 0ae6b12
Author: James <jh...@apache.org>
Authored: Mon Oct 17 11:57:45 2016 -0400
Committer: James Clampffer <ja...@hp.com>
Committed: Thu Mar 22 16:20:45 2018 -0400
----------------------------------------------------------------------
.../src/main/native/libhdfspp/include/hdfspp/options.h | 2 +-
.../src/main/native/libhdfspp/lib/common/retry_policy.cc | 7 ++++++-
.../src/main/native/libhdfspp/lib/rpc/rpc_engine.cc | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/062d8cd2/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/options.h
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/options.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/options.h
index 55093d0..b73a729 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/options.h
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/options.h
@@ -96,7 +96,7 @@ struct Options {
* Client failover attempts before failover gives up
**/
int failover_max_retries;
- static const unsigned int kDefaultFailoverMaxRetries = 15;
+ static const unsigned int kDefaultFailoverMaxRetries = 4;
/**
* Client failover attempts before failover gives up if server
http://git-wip-us.apache.org/repos/asf/hadoop/blob/062d8cd2/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/retry_policy.cc
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/retry_policy.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/retry_policy.cc
index ef78aca..148c674 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/retry_policy.cc
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/common/retry_policy.cc
@@ -60,7 +60,12 @@ RetryAction FixedDelayWithFailover::ShouldRetry(const Status &s, uint64_t retrie
{
// Try connecting to another NN in case this one keeps timing out
// Can add the backoff wait specified by dfs.client.failover.sleep.base.millis here
- return RetryAction::failover(delay_);
+ if(failovers == 0) {
+ // No delay on first failover if it looks like the NN was bad.
+ return RetryAction::failover(0);
+ } else {
+ return RetryAction::failover(delay_);
+ }
}
if(retries < max_retries_ && failovers < max_failover_retries_) {
http://git-wip-us.apache.org/repos/asf/hadoop/blob/062d8cd2/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc
index 4de6704..72a0c55 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc
+++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/rpc_engine.cc
@@ -365,7 +365,7 @@ void RpcEngine::RpcCommsError(
ResolvedNamenodeInfo new_active_nn_info =
ha_persisted_info_->GetFailoverAndUpdate(last_endpoints_[0]/*reverse lookup*/);
- LOG_INFO(kRPC, << "Going to try connecting to alternate Datanode: " << new_active_nn_info.uri.str());
+ LOG_INFO(kRPC, << "Going to try connecting to alternate Namenode: " << new_active_nn_info.uri.str());
if(ha_persisted_info_->is_resolved()) {
last_endpoints_ = new_active_nn_info.endpoints;
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org