Author: jing9 Date: Wed Feb 26 23:20:42 2014 New Revision: 1572338 URL: http://svn.apache.org/r1572338 Log: HDFS-6024. Test whether the NN will reject the downgrade if it has a fsimage from a newer release. Contributed by Haohui Mai.
Modified: hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java Modified: hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt?rev=1572338&r1=1572337&r2=1572338&view=diff ============================================================================== --- hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt (original) +++ hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-5535.txt Wed Feb 26 23:20:42 2014 @@ -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) Modified: hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java?rev=1572338&r1=1572337&r2=1572338&view=diff ============================================================================== --- hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java (original) +++ hadoop/common/branches/HDFS-5535/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRollingUpgrade.java Wed Feb 26 23:20:42 2014 @@ -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();