|
@@ -57,6 +57,7 @@ import org.junit.Assert;
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
import org.junit.Test;
|
|
|
|
|
|
+import static org.apache.hadoop.hdfs.server.namenode.ImageServlet.RECENT_IMAGE_CHECK_ENABLED;
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
import static org.junit.Assert.assertNotEquals;
|
|
|
import static org.junit.Assert.assertNull;
|
|
@@ -430,7 +431,22 @@ public class TestRollingUpgrade {
|
|
|
testFinalize(3);
|
|
|
}
|
|
|
|
|
|
+ @Test(timeout = 300000)
|
|
|
+ public void testFinalizeWithDeltaCheck() throws Exception {
|
|
|
+ testFinalize(2, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test(timeout = 300000)
|
|
|
+ public void testFinalizeWithMultipleNNDeltaCheck() throws Exception {
|
|
|
+ testFinalize(3, true);
|
|
|
+ }
|
|
|
+
|
|
|
private void testFinalize(int nnCount) throws Exception {
|
|
|
+ testFinalize(nnCount, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void testFinalize(int nnCount, boolean skipImageDeltaCheck)
|
|
|
+ throws Exception {
|
|
|
final Configuration conf = new HdfsConfiguration();
|
|
|
MiniQJMHACluster cluster = null;
|
|
|
final Path foo = new Path("/foo");
|
|
@@ -449,6 +465,10 @@ public class TestRollingUpgrade {
|
|
|
dfsCluster.restartNameNodes();
|
|
|
|
|
|
dfsCluster.transitionToActive(0);
|
|
|
+
|
|
|
+ dfsCluster.getNameNode(0).getHttpServer()
|
|
|
+ .setAttribute(RECENT_IMAGE_CHECK_ENABLED, skipImageDeltaCheck);
|
|
|
+
|
|
|
DistributedFileSystem dfs = dfsCluster.getFileSystem(0);
|
|
|
dfs.mkdirs(foo);
|
|
|
|