Author: cnauroth Date: Tue Apr 8 00:16:30 2014 New Revision: 1585630 URL: http://svn.apache.org/r1585630 Log: HDFS-6198. Merging change r1585628 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/datanode/BlockPoolSliceStorage.java hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockPoolSliceStorage.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=1585630&r1=1585629&r2=1585630&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 Tue Apr 8 00:16:30 2014 @@ -18,6 +18,9 @@ Release 2.4.1 - UNRELEASED HDFS-6197. Rolling upgrade rollback on Windows can fail attempting to rename edit log segment files to a destination that already exists. (cnauroth) + HDFS-6198. DataNode rolling upgrade does not correctly identify current + block pool directory and replace with trash on Windows. (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/datanode/BlockPoolSliceStorage.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/datanode/BlockPoolSliceStorage.java?rev=1585630&r1=1585629&r2=1585630&view=diff ============================================================================== --- hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java (original) +++ hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java Tue Apr 8 00:16:30 2014 @@ -61,7 +61,9 @@ public class BlockPoolSliceStorage exten static final String TRASH_ROOT_DIR = "trash"; private static final String BLOCK_POOL_ID_PATTERN_BASE = - "/BP-\\d+-\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}-\\d+/"; + Pattern.quote(File.separator) + + "BP-\\d+-\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}-\\d+" + + Pattern.quote(File.separator); private static final Pattern BLOCK_POOL_PATH_PATTERN = Pattern.compile( "^(.*)(" + BLOCK_POOL_ID_PATTERN_BASE + ")(.*)$"); Modified: hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockPoolSliceStorage.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/server/datanode/TestBlockPoolSliceStorage.java?rev=1585630&r1=1585629&r2=1585630&view=diff ============================================================================== --- hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockPoolSliceStorage.java (original) +++ hadoop/common/branches/branch-2.4/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockPoolSliceStorage.java Tue Apr 8 00:16:30 2014 @@ -77,10 +77,10 @@ public class TestBlockPoolSliceStorage { private String makeRandomBlockFileSubdir(int nestingLevel) { StringBuilder sb = new StringBuilder(); - sb.append("/"); + sb.append(File.separator); for (int i = 0; i < nestingLevel; ++i) { - sb.append("subdir" + rand.nextInt(64) + "/"); + sb.append("subdir" + rand.nextInt(64) + File.separator); } return sb.toString(); } @@ -94,12 +94,12 @@ public class TestBlockPoolSliceStorage { final String blockFileName = fileName; String testFilePath = - storage.getSingularStorageDir().getRoot() + "/" + + storage.getSingularStorageDir().getRoot() + File.separator + Storage.STORAGE_DIR_CURRENT + blockFileSubdir + blockFileName; String expectedTrashPath = - storage.getSingularStorageDir().getRoot() + "/" + + storage.getSingularStorageDir().getRoot() + File.separator + BlockPoolSliceStorage.TRASH_ROOT_DIR + blockFileSubdir.substring(0, blockFileSubdir.length() - 1); @@ -118,12 +118,12 @@ public class TestBlockPoolSliceStorage { final String blockFileName = fileName; String deletedFilePath = - storage.getSingularStorageDir().getRoot() + "/" + + storage.getSingularStorageDir().getRoot() + File.separator + BlockPoolSliceStorage.TRASH_ROOT_DIR + blockFileSubdir + blockFileName; String expectedRestorePath = - storage.getSingularStorageDir().getRoot() + "/" + + storage.getSingularStorageDir().getRoot() + File.separator + Storage.STORAGE_DIR_CURRENT + blockFileSubdir.substring(0, blockFileSubdir.length() - 1);