hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1004788 - in /hadoop/hdfs/trunk: CHANGES.txt src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestComputeInvalidateWork.java
Date Tue, 05 Oct 2010 19:39:59 GMT
Author: suresh
Date: Tue Oct  5 19:39:59 2010
New Revision: 1004788

URL: http://svn.apache.org/viewvc?rev=1004788&view=rev
Log:
HDFS-1440. Fix TestComputeInvalidateWork failure. Contributed by Suresh Srinvias.

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestComputeInvalidateWork.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1004788&r1=1004787&r2=1004788&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Tue Oct  5 19:39:59 2010
@@ -287,9 +287,11 @@ Trunk (unreleased changes)
     HDFS-1364. Makes long running HFTP-based applications do relogins
     if necessary. (Jitendra Pandey via ddas)
 
-    HDFS-1399.  Distinct minicluster services (e.g. NN and JT) overwrite each
+    HDFS-1399. Distinct minicluster services (e.g. NN and JT) overwrite each
     other's service policies.  (Aaron T. Myers via tomwhite)
 
+    HDFS-1440. Fix TestComputeInvalidateWork failure. (suresh)
+
 Release 0.21.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestComputeInvalidateWork.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestComputeInvalidateWork.java?rev=1004788&r1=1004787&r2=1004788&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestComputeInvalidateWork.java
(original)
+++ hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestComputeInvalidateWork.java
Tue Oct  5 19:39:59 2010
@@ -44,29 +44,32 @@ public class TestComputeInvalidateWork e
         namesystem.heartbeats.toArray(new DatanodeDescriptor[NUM_OF_DATANODES]);
       assertEquals(nodes.length, NUM_OF_DATANODES);
       
-      synchronized (namesystem) {
-      for (int i=0; i<nodes.length; i++) {
-        for(int j=0; j<3*namesystem.blockInvalidateLimit+1; j++) {
-          Block block = new Block(i*(namesystem.blockInvalidateLimit+1)+j, 0, 
-              GenerationStamp.FIRST_VALID_STAMP);
-          namesystem.blockManager.addToInvalidates(block, nodes[i]);
+      namesystem.writeLock();
+      try {
+        for (int i=0; i<nodes.length; i++) {
+          for(int j=0; j<3*namesystem.blockInvalidateLimit+1; j++) {
+            Block block = new Block(i*(namesystem.blockInvalidateLimit+1)+j, 0, 
+                GenerationStamp.FIRST_VALID_STAMP);
+            namesystem.blockManager.addToInvalidates(block, nodes[i]);
+          }
         }
-      }
-      
-      assertEquals(namesystem.blockInvalidateLimit*NUM_OF_DATANODES, 
-          namesystem.blockManager.computeInvalidateWork(NUM_OF_DATANODES+1));
-      assertEquals(namesystem.blockInvalidateLimit*NUM_OF_DATANODES, 
-          namesystem.blockManager.computeInvalidateWork(NUM_OF_DATANODES));
-      assertEquals(namesystem.blockInvalidateLimit*(NUM_OF_DATANODES-1), 
-          namesystem.blockManager.computeInvalidateWork(NUM_OF_DATANODES-1));
-      int workCount = namesystem.blockManager.computeInvalidateWork(1);
-      if (workCount == 1) {
-        assertEquals(namesystem.blockInvalidateLimit+1, 
-            namesystem.blockManager.computeInvalidateWork(2));
-      } else {
-        assertEquals(workCount, namesystem.blockInvalidateLimit);
-        assertEquals(2, namesystem.blockManager.computeInvalidateWork(2));
-      }
+        
+        assertEquals(namesystem.blockInvalidateLimit*NUM_OF_DATANODES, 
+            namesystem.blockManager.computeInvalidateWork(NUM_OF_DATANODES+1));
+        assertEquals(namesystem.blockInvalidateLimit*NUM_OF_DATANODES, 
+            namesystem.blockManager.computeInvalidateWork(NUM_OF_DATANODES));
+        assertEquals(namesystem.blockInvalidateLimit*(NUM_OF_DATANODES-1), 
+            namesystem.blockManager.computeInvalidateWork(NUM_OF_DATANODES-1));
+        int workCount = namesystem.blockManager.computeInvalidateWork(1);
+        if (workCount == 1) {
+          assertEquals(namesystem.blockInvalidateLimit+1, 
+              namesystem.blockManager.computeInvalidateWork(2));
+        } else {
+          assertEquals(workCount, namesystem.blockInvalidateLimit);
+          assertEquals(2, namesystem.blockManager.computeInvalidateWork(2));
+        }
+      } finally {
+        namesystem.writeUnlock();
       }
     } finally {
       cluster.shutdown();



Mime
View raw message