hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiten...@apache.org
Subject svn commit: r1165939 - in /hadoop/common/branches/branch-0.20-security: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Date Wed, 07 Sep 2011 00:24:37 GMT
Author: jitendra
Date: Wed Sep  7 00:24:36 2011
New Revision: 1165939

URL: http://svn.apache.org/viewvc?rev=1165939&view=rev
Log:
HDFS-2309. TestRenameWhileOpen fails.

Modified:
    hadoop/common/branches/branch-0.20-security/CHANGES.txt
    hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java
    hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

Modified: hadoop/common/branches/branch-0.20-security/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/CHANGES.txt?rev=1165939&r1=1165938&r2=1165939&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security/CHANGES.txt Wed Sep  7 00:24:36 2011
@@ -97,6 +97,8 @@ Release 0.20.205.0 - unreleased
     HADOOP-7596. Makes packaging of 64-bit jsvc possible. Has other
     bug fixes to do with packaging. (Eric Yang via ddas) 
 
+    HDFS-2309. TestRenameWhileOpen fails. (jitendra)
+
   IMPROVEMENTS
 
     MAPREDUCE-2187. Reporter sends progress during sort/merge. (Anupam Seth via

Modified: hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java?rev=1165939&r1=1165938&r2=1165939&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java
(original)
+++ hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/DatanodeDescriptor.java
Wed Sep  7 00:24:36 2011
@@ -118,6 +118,9 @@ public class DatanodeDescriptor extends 
   private long lastBlocksScheduledRollTime = 0;
   private static final int BLOCKS_SCHEDULED_ROLL_INTERVAL = 600*1000; //10min
   
+  // Set to false after processing first block report
+  private boolean firstBlockReport = true; 
+  
   /** Default constructor */
   public DatanodeDescriptor() {}
   
@@ -561,4 +564,12 @@ public class DatanodeDescriptor extends 
   public void setBalancerBandwidth(long bandwidth) {
     this.bandwidth = bandwidth;
   }
+
+  boolean firstBlockReport() {
+    return firstBlockReport;
+  }
+  
+  void processedBlockReport() {
+    firstBlockReport = false;
+  }
 }

Modified: hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=1165939&r1=1165938&r2=1165939&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
(original)
+++ hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Wed Sep  7 00:24:36 2011
@@ -84,7 +84,6 @@ import org.apache.hadoop.hdfs.server.com
 import org.apache.hadoop.hdfs.server.common.HdfsConstants.StartupOption;
 import org.apache.hadoop.hdfs.server.common.Storage;
 import org.apache.hadoop.hdfs.server.common.UpgradeStatusReport;
-import org.apache.hadoop.hdfs.server.common.HdfsConstants.StartupOption;
 import org.apache.hadoop.hdfs.server.namenode.BlocksMap.BlockInfo;
 import org.apache.hadoop.hdfs.server.namenode.LeaseManager.Lease;
 import org.apache.hadoop.hdfs.server.namenode.UnderReplicatedBlocks.BlockIterator;
@@ -3332,7 +3331,7 @@ public class FSNamesystem implements FSC
     
     // To minimize startup time, we discard any second (or later) block reports
     // that we receive while still in startup phase.
-    if (isInStartupSafeMode() && node.numBlocks() > 0) {
+    if (isInStartupSafeMode() && !node.firstBlockReport()) {
       NameNode.stateChangeLog.info("BLOCK* NameSystem.processReport: "
           + "discarded non-initial block report from " + nodeID.getName()
           + " because namenode still in startup phase");
@@ -3365,6 +3364,7 @@ public class FSNamesystem implements FSC
     NameNode.stateChangeLog.info("*BLOCK* NameSystem.processReport: from "
         + nodeID.getName() + ", blocks: " + newReport.getNumberOfBlocks()
         + ", processing time: " + (endTime - startTime) + " msecs");
+    node.processedBlockReport();
   }
 
   /**
@@ -3867,9 +3867,6 @@ public class FSNamesystem implements FSC
       throw new DisallowedDatanodeException(node);
     }
 
-    // decrement number of blocks scheduled to this datanode.
-    node.decBlocksScheduled();
-    
     // get the deletion hint node
     DatanodeDescriptor delHintNode = null;
     if(delHint!=null && delHint.length()!=0) {
@@ -3887,6 +3884,9 @@ public class FSNamesystem implements FSC
     // 
     pendingReplications.remove(block);
     addStoredBlock(block, node, delHintNode );
+    
+    // decrement number of blocks scheduled to this datanode.
+    node.decBlocksScheduled();    
   }
 
   public long getMissingBlocksCount() {



Mime
View raw message