hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hair...@apache.org
Subject svn commit: r820149 - in /hadoop/hdfs/branches/HDFS-265: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
Date Wed, 30 Sep 2009 02:06:14 GMT
Author: hairong
Date: Wed Sep 30 02:06:12 2009
New Revision: 820149

URL: http://svn.apache.org/viewvc?rev=820149&view=rev
Log:
HDFS-661. DataNode upgrade fails on non-existant current directory. Contributed by Hairong
Kuang.

Modified:
    hadoop/hdfs/branches/HDFS-265/CHANGES.txt
    hadoop/hdfs/branches/HDFS-265/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java

Modified: hadoop/hdfs/branches/HDFS-265/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/HDFS-265/CHANGES.txt?rev=820149&r1=820148&r2=820149&view=diff
==============================================================================
--- hadoop/hdfs/branches/HDFS-265/CHANGES.txt (original)
+++ hadoop/hdfs/branches/HDFS-265/CHANGES.txt Wed Sep 30 02:06:12 2009
@@ -95,6 +95,9 @@
     HDFS-649. Check null pointers for DataTransferTest.  (Konstantin Boudnik
     via szetszwo)
 
+    HDFS-661. DataNode upgrade fails on non-existant current directory.
+    (hairong)
+
 Trunk (unreleased changes)
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hdfs/branches/HDFS-265/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/HDFS-265/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java?rev=820149&r1=820148&r2=820149&view=diff
==============================================================================
--- hadoop/hdfs/branches/HDFS-265/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
(original)
+++ hadoop/hdfs/branches/HDFS-265/src/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
Wed Sep 30 02:06:12 2009
@@ -284,6 +284,9 @@
     rename(curDir, tmpDir);
     // hard link finalized & rbw blocks
     linkAllBlocks(tmpDir, curDir);
+    // create current directory if not exists
+    if (!curDir.exists() && !curDir.mkdirs())
+      throw new IOException("Cannot create directory " + curDir);
     // write version file
     this.layoutVersion = FSConstants.LAYOUT_VERSION;
     assert this.namespaceID == nsInfo.getNamespaceID() :



Mime
View raw message