Sfoglia il codice sorgente

Merge -r 538313:538318 from trunk to 0.13 branch. Fixes: HADOOP-1205, HADOOP-1353, HADOOP-1354 and HADOOP-1358.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/branches/branch-0.13@538320 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 anni fa
parent
commit
322a949c5e

+ 12 - 0
CHANGES.txt

@@ -378,6 +378,18 @@ Branch 0.13 (unreleased changes)
 112. HADOOP-1345.  Fix HDFS to correctly retry another replica when a
      checksum error is encountered.  (Hairong Kuang via cutting)
 
+113. HADOOP-1205.  Improve synchronization around HDFS block map.
+     (Hairong Kuang via cutting)
+
+114. HADOOP-1353.  Fix a potential NullPointerException in namenode.
+     (Dhruba Borthakur via cutting)
+
+115. HADOOP-1354.  Fix a potential NullPointerException in FsShell.
+     (Hairong Kuang via cutting)
+
+116. HADOOP-1358.  Fix a potential bug when DFSClient calls skipBytes.
+     (Hairong Kuang via cutting)
+
 
 Release 0.12.3 - 2007-04-06
 

+ 5 - 4
src/java/org/apache/hadoop/dfs/DFSClient.java

@@ -926,10 +926,11 @@ class DFSClient implements FSConstants {
         //
         int diff = (int)(targetPos - pos);
         if (diff <= TCP_WINDOW_SIZE) {
-          blockStream.skipBytes(diff);
-          pos += diff;
-          assert(pos == targetPos);
-          done = true;
+          int adiff = blockStream.skipBytes(diff);
+          pos += adiff;
+          if (pos == targetPos) {
+            done = true;
+          }
         }
       }
       if (!done) {

+ 2 - 2
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -434,7 +434,7 @@ class FSNamesystem implements FSConstants {
    * The client should choose one of the machines from the machineArray
    * at random.
    */
-  public Object[] open(String clientMachine, UTF8 src) {
+  synchronized public Object[] open(String clientMachine, UTF8 src) {
     Object results[] = null;
     Block blocks[] = dir.getFile(src);
     if (blocks != null) {
@@ -1813,7 +1813,7 @@ class FSNamesystem implements FSConstants {
       removeDatanode(nodeInfo);
     } else {
       NameNode.stateChangeLog.warn("BLOCK* NameSystem.removeDatanode: "
-                                   + nodeInfo.getName() + " does not exist");
+                                   + nodeID.getName() + " does not exist");
     }
   }
   

+ 1 - 1
src/java/org/apache/hadoop/fs/FsShell.java

@@ -369,7 +369,7 @@ public class FsShell extends ToolBase {
    */
   public void dus(String src) throws IOException {
     Path paths[] = fs.globPaths(new Path(src));
-    if (paths==null && paths.length==0) {
+    if (paths==null || paths.length==0) {
       throw new IOException("dus: No match: " + src);
     }
     for(int i=0; i<paths.length; i++) {