hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hair...@apache.org
Subject svn commit: r743895 - in /hadoop/core/branches/branch-0.20: ./ src/hdfs/org/apache/hadoop/hdfs/server/datanode/ src/test/org/apache/hadoop/hdfs/server/datanode/
Date Thu, 12 Feb 2009 21:42:56 GMT
Author: hairong
Date: Thu Feb 12 21:42:55 2009
New Revision: 743895

URL: http://svn.apache.org/viewvc?rev=743895&view=rev
Log:
Merge -r 743891:743892 from trunk to move the change of HADOOP-5192 to branch 0.20.

Added:
    hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockAlreadyExistsException.java
      - copied unchanged from r743892, hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockAlreadyExistsException.java
Modified:
    hadoop/core/branches/branch-0.20/   (props changed)
    hadoop/core/branches/branch-0.20/CHANGES.txt   (contents, props changed)
    hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
    hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
    hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java

Propchange: hadoop/core/branches/branch-0.20/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 12 21:42:55 2009
@@ -1,2 +1,2 @@
 /hadoop/core/branches/branch-0.19:713112
-/hadoop/core/trunk:727001,727117,727191,727212,727217,727228,727255,727869,728187,729052,729987,732385,732572,732777,732838,732869,733887,734870,734916,736426,738328,738697,740077,740157,741703,741762,743745
+/hadoop/core/trunk:727001,727117,727191,727212,727217,727228,727255,727869,728187,729052,729987,732385,732572,732777,732838,732869,733887,734870,734916,736426,738328,738697,740077,740157,741703,741762,743745,743892

Modified: hadoop/core/branches/branch-0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/CHANGES.txt?rev=743895&r1=743894&r2=743895&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.20/CHANGES.txt Thu Feb 12 21:42:55 2009
@@ -1669,6 +1669,9 @@
     HADOOP-5114. Remove timeout for accept() in DataNode. This makes accept() 
     fail in JDK on Windows and causes many tests to fail. (Raghu Angadi)
 
+    HADOOP-5192. Block receiver should not remove a block that's created or
+    being written by other threads. (hairong)
+ 
 Release 0.18.3 - 2009-01-27
 
   IMPROVEMENTS

Propchange: hadoop/core/branches/branch-0.20/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 12 21:42:55 2009
@@ -1,3 +1,3 @@
 /hadoop/core/branches/branch-0.18/CHANGES.txt:727226
 /hadoop/core/branches/branch-0.19/CHANGES.txt:713112
-/hadoop/core/trunk/CHANGES.txt:727001,727117,727191,727212,727228,727255,727869,728187,729052,729987,732385,732572,732777,732838,732869,733887,734870,734916,735082,736426,738602,738697,739416,740077,740157,741703,741762,743296,743745
+/hadoop/core/trunk/CHANGES.txt:727001,727117,727191,727212,727228,727255,727869,728187,729052,729987,732385,732572,732777,732838,732869,733887,734870,734916,735082,736426,738602,738697,739416,740077,740157,741703,741762,743296,743745,743892

Modified: hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java?rev=743895&r1=743894&r2=743895&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
(original)
+++ hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
Thu Feb 12 21:42:55 2009
@@ -107,9 +107,11 @@
           datanode.blockScanner.deleteBlock(block);
         }
       }
+    } catch (BlockAlreadyExistsException bae) {
+      throw bae;
     } catch(IOException ioe) {
       IOUtils.closeStream(this);
-      removeBlock();
+      cleanupBlock();
       
       // check if there is a disk error
       IOException cause = FSDataset.getCauseIfDiskError(ioe);
@@ -557,7 +559,7 @@
       if (responder != null) {
         responder.interrupt();
       }
-      removeBlock();
+      cleanupBlock();
       throw ioe;
     } finally {
       if (responder != null) {
@@ -571,10 +573,10 @@
     }
   }
 
-  /** Remove a partial block 
+  /** Cleanup a partial block 
    * if this write is for a replication request (and not from a client)
    */
-  private void removeBlock() throws IOException {
+  private void cleanupBlock() throws IOException {
     if (clientName.length() == 0) { // not client write
       datanode.data.unfinalizeBlock(block);
     }

Modified: hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java?rev=743895&r1=743894&r2=743895&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
(original)
+++ hadoop/core/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
Thu Feb 12 21:42:55 2009
@@ -975,7 +975,7 @@
     //
     if (isValidBlock(b)) {
       if (!isRecovery) {
-        throw new IOException("Block " + b + " is valid, and cannot be written to.");
+        throw new BlockAlreadyExistsException("Block " + b + " is valid, and cannot be written
to.");
       }
       // If the block was successfully finalized because all packets
       // were successfully processed at the Datanode but the ack for
@@ -1001,7 +1001,7 @@
         threads = activeFile.threads;
         
         if (!isRecovery) {
-          throw new IOException("Block " + b +
+          throw new BlockAlreadyExistsException("Block " + b +
                                   " has already been started (though not completed), and
thus cannot be created.");
         } else {
           for (Thread thread:threads) {

Modified: hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java?rev=743895&r1=743894&r2=743895&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java
(original)
+++ hadoop/core/branches/branch-0.20/src/test/org/apache/hadoop/hdfs/server/datanode/SimulatedFSDataset.java
Thu Feb 12 21:42:55 2009
@@ -373,7 +373,7 @@
                                             boolean isRecovery)
                                             throws IOException {
     if (isValidBlock(b)) {
-          throw new IOException("Block " + b + 
+          throw new BlockAlreadyExistsException("Block " + b + 
               " is valid, and cannot be written to.");
       }
       BInfo binfo = new BInfo(b, true);



Mime
View raw message