HDFS-7051. TestDataNodeRollingUpgrade#isBlockFileInPrevious assumes Unix file path separator. Contributed by Chris Nauroth.
This commit is contained in:
parent
6b8b1608e6
commit
d6ce26986e
@ -754,6 +754,9 @@ Release 2.6.0 - UNRELEASED
|
||||
HDFS-7042. Upgrade fails for Windows HA cluster due to file locks held during
|
||||
rename in JournalNode. (cnauroth)
|
||||
|
||||
HDFS-7051. TestDataNodeRollingUpgrade#isBlockFileInPrevious assumes Unix file
|
||||
path separator. (cnauroth)
|
||||
|
||||
Release 2.5.1 - 2014-09-05
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -157,7 +157,9 @@ private void ensureTrashRestored(File blockFile, File trashFile)
|
||||
}
|
||||
|
||||
private boolean isBlockFileInPrevious(File blockFile) {
|
||||
Pattern blockFilePattern = Pattern.compile("^(.*/current/.*/)(current)(/.*)$");
|
||||
Pattern blockFilePattern = Pattern.compile(String.format(
|
||||
"^(.*%1$scurrent%1$s.*%1$s)(current)(%1$s.*)$",
|
||||
Pattern.quote(File.separator)));
|
||||
Matcher matcher = blockFilePattern.matcher(blockFile.toString());
|
||||
String previousFileName = matcher.replaceFirst("$1" + "previous" + "$3");
|
||||
return ((new File(previousFileName)).exists());
|
||||
@ -355,7 +357,7 @@ public void testWithLayoutChangeAndFinalize() throws Exception {
|
||||
assertTrue(isBlockFileInPrevious(blockFiles[1]));
|
||||
assertFalse(isTrashRootPresent());
|
||||
|
||||
// Rollback and ensure that neither block file exists in trash or previous.
|
||||
// Finalize and ensure that neither block file exists in trash or previous.
|
||||
finalizeRollingUpgrade();
|
||||
assertFalse(isTrashRootPresent());
|
||||
assertFalse(isBlockFileInPrevious(blockFiles[0]));
|
||||
|
Loading…
x
Reference in New Issue
Block a user