소스 검색

merge -r 817352:818319 from branch-0.21 to the append branch

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/branches/HDFS-265@818330 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 15 년 전
부모
커밋
9e146f69a9

+ 5 - 1
CHANGES.txt

@@ -325,7 +325,11 @@ Trunk (unreleased changes)
     HDFS-629. Remove ReplicationTargetChooser.java along with fixing 
     import warnings generated by Eclipse. (dhruba)
 
-Release 0.20.1 - Unreleased
+    HDFS-640. Fix TestHDFSFileContextMainOperations.java build failure. (suresh)
+
+    HDFS-637. DataNode sends a Success ack when block write fails. (hairong)
+
+Release 0.20.1 - 2009-09-01
 
   IMPROVEMENTS
 

BIN
lib/hadoop-core-0.21.0-dev.jar


BIN
lib/hadoop-core-test-0.21.0-dev.jar


+ 8 - 2
src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java

@@ -914,6 +914,7 @@ class BlockReceiver implements java.io.Closeable, FSConstants {
       final long startTime = ClientTraceLog.isInfoEnabled() ? System.nanoTime() : 0;
       while (running && datanode.shouldRun && !lastPacketInBlock) {
 
+        boolean isInterrupted = false;
         try {
             DataTransferProtocol.Status op = SUCCESS;
             boolean didRead = false;
@@ -941,7 +942,12 @@ class BlockReceiver implements java.io.Closeable, FSConstants {
                                 " for block " + block +
                                 " waiting for local datanode to finish write.");
                     }
-                    wait();
+                    try {
+                      wait();
+                    } catch (InterruptedException e) {
+                      isInterrupted = true;
+                      throw e;
+                    }
                   }
                   pkt = ackQueue.removeFirst();
                   expected = pkt.seqno;
@@ -967,7 +973,7 @@ class BlockReceiver implements java.io.Closeable, FSConstants {
               }
             }
 
-            if (Thread.interrupted()) {
+            if (Thread.interrupted() || isInterrupted) {
               /* The receiver thread cancelled this thread. 
                * We could also check any other status updates from the 
                * receiver thread (e.g. if it is ok to write to replyOut). 

+ 1 - 1
src/test/hdfs/org/apache/hadoop/fs/TestHDFSFileContextMainOperations.java

@@ -44,7 +44,7 @@ public class TestHDFSFileContextMainOperations extends
     fc = FileContext.getFileContext(cluster.getFileSystem());
     defaultWorkingDirectory = fc.makeQualified( new Path("/user/" + 
         UnixUserGroupInformation.login().getUserName()));
-    fc.mkdirs(defaultWorkingDirectory, FileContext.DEFAULT_PERM);
+    fc.mkdir(defaultWorkingDirectory, FileContext.DEFAULT_PERM, true);
   }