hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hair...@apache.org
Subject svn commit: r1035718 - in /hadoop/hdfs/trunk: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java src/test/hdfs/org/apache/hadoop/hdfs/TestPipelines.java
Date Tue, 16 Nov 2010 18:06:35 GMT
Author: hairong
Date: Tue Nov 16 18:06:34 2010
New Revision: 1035718

URL: http://svn.apache.org/viewvc?rev=1035718&view=rev
Log:
HDFS-1467. Append pipeline not succeeds with more than one replica. Contributed by Todd Lipcon.

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
    hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/TestPipelines.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1035718&r1=1035717&r2=1035718&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Tue Nov 16 18:06:34 2010
@@ -53,12 +53,16 @@ Trunk (unreleased changes)
     HDFS-1500. TestOfflineImageViewer failing on trunk. (Todd Lipcon
     via hairong)
 
+    HDFS-1467. Append pipeline construction not succeeds with more than
+    one replica. (Todd Lipcon via hairong)
+
   IMPROVEMENTS
 
     HDFS-1304. Add a new unit test for HftpFileSystem.open(..).  (szetszwo)
 
     HDFS-1096. fix for prev. commit. (boryas)
 
+
     HDFS-1096. allow dfsadmin/mradmin refresh of superuser proxy group
      mappings (boryas)
 

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java?rev=1035718&r1=1035717&r2=1035718&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java Tue
Nov 16 18:06:34 2010
@@ -82,13 +82,13 @@ class BlockReceiver implements java.io.C
   final private ReplicaInPipelineInterface replicaInfo;
   volatile private boolean mirrorError;
 
-  BlockReceiver(Block block, DataInputStream in, String inAddr,
+  BlockReceiver(Block inBlock, DataInputStream in, String inAddr,
                 String myAddr, BlockConstructionStage stage, 
                 long newGs, long minBytesRcvd, long maxBytesRcvd, 
                 String clientName, DatanodeInfo srcDataNode, DataNode datanode)
                 throws IOException {
     try{
-      this.block = block;
+      this.block = new Block(inBlock);
       this.in = in;
       this.inAddr = inAddr;
       this.myAddr = myAddr;

Modified: hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/TestPipelines.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/TestPipelines.java?rev=1035718&r1=1035717&r2=1035718&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/TestPipelines.java (original)
+++ hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/TestPipelines.java Tue Nov 16 18:06:34
2010
@@ -103,12 +103,16 @@ public class TestPipelines {
     List<LocatedBlock> lb = cluster.getNameNode().getBlockLocations(
       filePath.toString(), FILE_SIZE - 1, FILE_SIZE).getLocatedBlocks();
 
-    Replica r = DataNodeAdapter.fetchReplicaInfo(cluster.getDataNodes().get(0),
-      lb.get(0).getBlock().getBlockId());
-    assertTrue("Replica shouldn'e be null", r != null);
-    assertEquals(
-      "Should be RBW replica after sequence of calls append()/write()/hflush()",
-      HdfsConstants.ReplicaState.RBW, r.getState());
+    for (DataNode dn : cluster.getDataNodes()) {
+      Replica r = DataNodeAdapter.fetchReplicaInfo(
+        dn, lb.get(0).getBlock().getBlockId());
+
+      assertTrue("Replica on DN " + dn + " shouldn't be null", r != null);
+      assertEquals(
+        "Should be RBW replica on " + dn + " after sequence of calls " +
+        "append()/write()/hflush()",
+        HdfsConstants.ReplicaState.RBW, r.getState());
+    }
     ofs.close();
   }
 



Mime
View raw message