فهرست منبع

HADOOP-4997. Revert tmp files handling on DataNodes back to 0.17.\nsync() introduced in 0.18 has less gaurantees (Raghu Angadi).

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.18@735183 13f79535-47bb-0310-9956-ffa450edef68
Raghu Angadi 16 سال پیش
والد
کامیت
c7c0b33b65

+ 3 - 0
CHANGES.txt

@@ -136,6 +136,9 @@ Release 0.18.3 - Unreleased
     HADOOP-4910. NameNode should exclude replicas when choosing excessive
     replicas to delete to avoid data lose. (hairong)
 
+    HADOOP-4997. Revert tmp files handling on DataNodes back to 0.17.
+    sync() introduced in 0.18 has less gaurantees (Raghu Angadi).
+
 Release 0.18.2 - 2008-11-03
 
   BUG FIXES

+ 2 - 5
src/hdfs/org/apache/hadoop/dfs/FSDataset.java

@@ -300,14 +300,11 @@ class FSDataset implements FSConstants, FSDatasetInterface {
         recoverDetachedBlocks(currentDir, detachDir);
       }
 
-      // Files that were being written when the datanode was last shutdown
-      // are now moved back to the data directory. It is possible that
-      // in the future, we might want to do some sort of datanode-local
-      // recovery for these blocks. For example, crc validation.
+      // Delete all temporary blocks in the tmp diectory
       //
       this.tmpDir = new File(parent, "tmp");
       if (tmpDir.exists()) {
-        recoverDetachedBlocks(currentDir, tmpDir);
+        FileUtil.fullyDelete(tmpDir);
       }
       this.dataDir = new FSDir(currentDir);
       if (!tmpDir.mkdirs()) {

+ 3 - 0
src/test/org/apache/hadoop/dfs/TestFileCreationDelete.java

@@ -34,6 +34,9 @@ public class TestFileCreationDelete extends junit.framework.TestCase {
   }
 
   public void testFileCreationDeleteParent() throws IOException {
+    /* XXX This test is temporarily disabled since sync() is not supported in
+     * 0.18.3. This is a 0.18.3 only change. */
+    if (true) return;
     Configuration conf = new Configuration();
     final int MAX_IDLE_TIME = 2000; // 2s
     conf.setInt("ipc.client.connection.maxidletime", MAX_IDLE_TIME);

+ 12 - 0
src/test/org/apache/hadoop/dfs/TestRenameWhileOpen.java

@@ -92,6 +92,9 @@ public class TestRenameWhileOpen extends junit.framework.TestCase {
    * move /user/dir1 /user/dir3
    */
   public void testWhileOpenRenameParent() throws IOException {
+    /* XXX This test is temporarily disabled since sync() is not supported in
+     * 0.18.3. This is a 0.18.3 only change. */
+    if (true) return;
     Configuration conf = new Configuration();
     final int MAX_IDLE_TIME = 2000; // 2s
     conf.setInt("ipc.client.connection.maxidletime", MAX_IDLE_TIME);
@@ -164,6 +167,9 @@ public class TestRenameWhileOpen extends junit.framework.TestCase {
    * move /user/dir1 /user/dir3
    */
   public void testWhileOpenRenameParentToNonexistentDir() throws IOException {
+    /* XXX This test is temporarily disabled since sync() is not supported in
+     * 0.18.3. This is a 0.18.3 only change. */
+    if (true) return;
     Configuration conf = new Configuration();
     final int MAX_IDLE_TIME = 2000; // 2s
     conf.setInt("ipc.client.connection.maxidletime", MAX_IDLE_TIME);
@@ -236,6 +242,9 @@ public class TestRenameWhileOpen extends junit.framework.TestCase {
    * move /user/dir1/file1 /user/dir2/
    */
   public void testWhileOpenRenameToExistentDirectory() throws IOException {
+    /* XXX This test is temporarily disabled since sync() is not supported in
+     * 0.18.3. This is a 0.18.3 only change. */
+    if (true) return;
     Configuration conf = new Configuration();
     final int MAX_IDLE_TIME = 2000; // 2s
     conf.setInt("ipc.client.connection.maxidletime", MAX_IDLE_TIME);
@@ -298,6 +307,9 @@ public class TestRenameWhileOpen extends junit.framework.TestCase {
    * move /user/dir1/file1 /user/dir2/
    */
   public void testWhileOpenRenameToNonExistentDirectory() throws IOException {
+    /* XXX This test is temporarily disabled since sync() is not supported in
+     * 0.18.3. This is a 0.18.3 only change. */
+    if (true) return;
     Configuration conf = new Configuration();
     final int MAX_IDLE_TIME = 2000; // 2s
     conf.setInt("ipc.client.connection.maxidletime", MAX_IDLE_TIME);