hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnaur...@apache.org
Subject svn commit: r1585592 - in /hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java
Date Mon, 07 Apr 2014 21:33:29 GMT
Author: cnauroth
Date: Mon Apr  7 21:33:28 2014
New Revision: 1585592

URL: http://svn.apache.org/r1585592
Log:
HDFS-6197. Merging change r1585591 from branch-2 to branch-2.4

Modified:
    hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java
    hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java

Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1585592&r1=1585591&r2=1585592&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Mon Apr
 7 21:33:28 2014
@@ -15,6 +15,9 @@ Release 2.4.1 - UNRELEASED
     HDFS-6189. Multiple HDFS tests fail on Windows attempting to use a test
     root path containing a colon.  (cnauroth via szetszwo) 
 
+    HDFS-6197. Rolling upgrade rollback on Windows can fail attempting to rename
+    edit log segment files to a destination that already exists. (cnauroth)
+
 Release 2.4.0 - 2014-04-07 
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java?rev=1585592&r1=1585591&r2=1585592&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java
(original)
+++ hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java
Mon Apr  7 21:33:28 2014
@@ -512,10 +512,12 @@ public class FileJournalManager implemen
     private void renameSelf(String newSuffix) throws IOException {
       File src = file;
       File dst = new File(src.getParent(), src.getName() + newSuffix);
-      boolean success = src.renameTo(dst);
-      if (!success) {
-        throw new IOException(
-          "Couldn't rename log " + src + " to " + dst);
+      // renameTo fails on Windows if the destination file already exists.
+      if (!src.renameTo(dst)) {
+        if (!dst.delete() || !src.renameTo(dst)) {
+          throw new IOException(
+            "Couldn't rename log " + src + " to " + dst);
+        }
       }
       file = dst;
     }

Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java?rev=1585592&r1=1585591&r2=1585592&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java
(original)
+++ hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java
Mon Apr  7 21:33:28 2014
@@ -195,6 +195,7 @@ public class TestRollingUpgrade {
         Assert.assertEquals(info1, dfs.rollingUpgrade(RollingUpgradeAction.QUERY));
   
         dfs.mkdirs(bar);
+        cluster.shutdown();
       }
 
       // cluster2 takes over QJM



Mime
View raw message