HDFS-7051. TestDataNodeRollingUpgrade#isBlockFileInPrevious assumes Unix file path separator. Contributed by Chris Nauroth.
(cherry picked from commit d6ce26986e
)
This commit is contained in:
parent
efa9ab3638
commit
993ede4db3
|
@ -496,6 +496,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 @@ public class TestDataNodeRollingUpgrade {
|
|||
}
|
||||
|
||||
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 class TestDataNodeRollingUpgrade {
|
|||
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…
Reference in New Issue