hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1095830 - in /hadoop/hdfs/trunk: CHANGES.txt src/test/hdfs/org/apache/hadoop/hdfs/TestDatanodeBlockScanner.java
Date Thu, 21 Apr 2011 22:01:27 GMT
Author: eli
Date: Thu Apr 21 22:01:27 2011
New Revision: 1095830

URL: http://svn.apache.org/viewvc?rev=1095830&view=rev
Log:
HDFS-1855. TestDatanodeBlockScanner.testBlockCorruptionRecoveryPolicy() part 2 fails in two
different ways. Contributed by Matt Foley

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/TestDatanodeBlockScanner.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1095830&r1=1095829&r2=1095830&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Thu Apr 21 22:01:27 2011
@@ -726,6 +726,9 @@ Release 0.21.1 - Unreleased
     HDFS-1786. Some cli test cases expect a "null" message
     (Uma Maheswara Rao G via todd)
 
+    HDFS-1855. TestDatanodeBlockScanner.testBlockCorruptionRecoveryPolicy()
+    part 2 fails in two different ways. (Matt Foley via eli)
+
 Release 0.21.0 - 2010-08-13
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/TestDatanodeBlockScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/TestDatanodeBlockScanner.java?rev=1095830&r1=1095829&r2=1095830&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/TestDatanodeBlockScanner.java (original)
+++ hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/TestDatanodeBlockScanner.java Thu
Apr 21 22:01:27 2011
@@ -322,9 +322,16 @@ public class TestDatanodeBlockScanner ex
     
     // Restart the datanodes containing corrupt replicas 
     // so they would be reported to namenode and re-replicated
-    for (int i =0; i < numCorruptReplicas; i++) 
+    // They MUST be restarted in reverse order from highest to lowest index,
+    // because the act of restarting them removes them from the ArrayList
+    // and causes the indexes of all nodes above them in the list to change.
+    for (int i = numCorruptReplicas - 1; i >= 0 ; i--) {
+      LOG.info("restarting node with corrupt replica: position " 
+          + i + " node " + corruptReplicasDNIDs[i] + " " 
+          + cluster.getDataNodes().get(corruptReplicasDNIDs[i]).getSelfAddr());
      cluster.restartDataNode(corruptReplicasDNIDs[i]);
-
+    }
+    
     // Loop until all corrupt replicas are reported
     int corruptReplicaSize = cluster.getNamesystem().
                               numCorruptReplicas(blk);



Mime
View raw message