瀏覽代碼

HDFS-127. Reset failure count in DFSClient for each block acquiring operation. Contributed by Igor Bolotin

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20@828902 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 15 年之前
父節點
當前提交
b002ef9dce
共有 2 個文件被更改,包括 7 次插入0 次删除
  1. 5 0
      CHANGES.txt
  2. 2 0
      src/hdfs/org/apache/hadoop/hdfs/DFSClient.java

+ 5 - 0
CHANGES.txt

@@ -7,6 +7,11 @@ Release 0.20.2 - Unreleased
     HADOOP-6218. Adds a feature where TFile can be split by Record
     Sequence number. (Hong Tang and Raghu Angadi via ddas)
 
+  IMPROVEMENTS
+
+    HDFS-127. Reset failure count in DFSClient for each block acquiring
+    operation.  (Igor Bolotin via szetszwo)
+
   BUG FIXES
 
     MAPREDUCE-112. Add counters for reduce input, output records to the new API.

+ 2 - 0
src/hdfs/org/apache/hadoop/hdfs/DFSClient.java

@@ -1611,6 +1611,7 @@ public class DFSClient implements FSConstants, java.io.Closeable {
       // Connect to best DataNode for desired Block, with potential offset
       //
       DatanodeInfo chosenNode = null;
+      failures = 0;
       while (s == null) {
         DNAddrPair retval = chooseDataNode(targetBlock);
         chosenNode = retval.info;
@@ -1811,6 +1812,7 @@ public class DFSClient implements FSConstants, java.io.Closeable {
       Socket dn = null;
       int numAttempts = block.getLocations().length;
       IOException ioe = null;
+      failures = 0;
       
       while (dn == null && numAttempts-- > 0 ) {
         DNAddrPair retval = chooseDataNode(block);