From d08b1af26a56b096c7087b46a3ccd4417f4cc7ef Mon Sep 17 00:00:00 2001 From: Todd Lipcon Date: Mon, 14 Jan 2013 21:34:22 +0000 Subject: [PATCH] HDFS-4400. DFSInputStream#getBlockReader: last retries should ignore the cache. Contributed by Colin Patrick McCabe. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-347@1433144 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-347.txt | 2 ++ .../src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-347.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-347.txt index ad9e4abd43..1289d9e21a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-347.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-347.txt @@ -17,3 +17,5 @@ HDFS-4388. DomainSocket should throw AsynchronousCloseException when appropriate HDFS-4390. Bypass UNIX domain socket unit tests when they cannot be run. (Colin Patrick McCabe via todd) +HDFS-4400. DFSInputStream#getBlockReader: last retries should ignore the cache +(Colin Patrick McCabe via todd) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java index a33f8f54e7..0f4b7e350f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java @@ -941,7 +941,7 @@ protected BlockReader getBlockReader(InetSocketAddress dnAddr, // equivalent to declaring the DataNode bad. boolean triedNonDomainSocketReader = false; for (int retries = 0; - retries < nCachedConnRetry && (!triedNonDomainSocketReader); + retries < nCachedConnRetry || (!triedNonDomainSocketReader); ++retries) { Peer peer = null; if (retries < nCachedConnRetry) {