浏览代码

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
Todd Lipcon 12 年之前
父节点
当前提交
d08b1af26a

+ 2 - 0
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)

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java

@@ -941,7 +941,7 @@ public class DFSInputStream extends FSInputStream implements ByteBufferReadable
     // 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) {