From aee7b449e2cd9a13dd2c072276f3c8d349f69876 Mon Sep 17 00:00:00 2001 From: Jing Zhao Date: Wed, 26 Feb 2014 23:20:42 +0000 Subject: [PATCH] HDFS-6024. Test whether the NN will reject the downgrade if it has a fsimage from a newer release. Contributed by Haohui Mai. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-5535@1572338 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop-hdfs/CHANGES_HDFS-5535.txt | 3 ++ .../hadoop/hdfs/TestRollingUpgrade.java | 38 ------------------- 2 files changed, 3 insertions(+), 38 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt index 7eb6e792540..a9dc4a564f3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt @@ -111,3 +111,6 @@ HDFS-5535 subtasks: HDFS-6023. Test whether the standby NN continues to checkpoint after the prepare stage. (Haohui Mai via jing9) + + HDFS-6024. Test whether the NN will reject the downgrade if it has a + fsimage from a newer release. (Haohui Mai via jing9) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java index cf3110651f2..1ee101f5f88 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java @@ -347,44 +347,6 @@ public class TestRollingUpgrade { } } - @Test - public void testDowngrade() throws Exception { - final Configuration conf = new HdfsConfiguration(); - MiniQJMHACluster cluster = null; - final Path foo = new Path("/foo"); - final Path bar = new Path("/bar"); - - try { - cluster = new MiniQJMHACluster.Builder(conf).build(); - MiniDFSCluster dfsCluster = cluster.getDfsCluster(); - dfsCluster.waitActive(); - - dfsCluster.transitionToActive(0); - DistributedFileSystem dfs = dfsCluster.getFileSystem(0); - dfs.mkdirs(foo); - - // start rolling upgrade - RollingUpgradeInfo info = dfs - .rollingUpgrade(RollingUpgradeAction.PREPARE); - Assert.assertTrue(info.isStarted()); - dfs.mkdirs(bar); - dfs.close(); - - dfsCluster.restartNameNode(0, true, "-rollingUpgrade", "downgrade"); - // shutdown NN1 - dfsCluster.shutdownNameNode(1); - dfsCluster.transitionToActive(0); - - dfs = dfsCluster.getFileSystem(0); - Assert.assertTrue(dfs.exists(foo)); - Assert.assertTrue(dfs.exists(bar)); - } finally { - if (cluster != null) { - cluster.shutdown(); - } - } - } - @Test (timeout = 300000) public void testFinalize() throws Exception { final Configuration conf = new HdfsConfiguration();