ayushtkn commented on code in PR #7845: URL: https://github.com/apache/hadoop/pull/7845#discussion_r2265163645
########## hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java: ########## @@ -649,6 +649,50 @@ public void testCheckpointSucceedsWithLegacyOIVException() throws Exception { HATestUtil.waitForCheckpoint(cluster, 0, ImmutableList.of(12)); } + /** + * Test that lastCheckpointTime is correctly updated at each checkpoint + */ + @Test(timeout = 300000) + public void testLastCheckpointTime() throws Exception { Review Comment: This test is passing with your prod change as well for me ########## hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestStandbyCheckpoints.java: ########## @@ -649,6 +649,50 @@ public void testCheckpointSucceedsWithLegacyOIVException() throws Exception { HATestUtil.waitForCheckpoint(cluster, 0, ImmutableList.of(12)); } + /** + * Test that lastCheckpointTime is correctly updated at each checkpoint + */ + @Test(timeout = 300000) + public void testLastCheckpointTime() throws Exception { + for (int i = 1; i < NUM_NNS; i++) { + cluster.shutdownNameNode(i); + + // Make true checkpoint for DFS_NAMENODE_CHECKPOINT_PERIOD_KEY + cluster.getConfiguration(i).setInt(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_PERIOD_KEY, 3); + cluster.getConfiguration(i).setInt(DFSConfigKeys.DFS_NAMENODE_CHECKPOINT_TXNS_KEY, 1000); + } + + doEdits(0, 10); + cluster.transitionToStandby(0); + + // Standby NNs do checkpoint without active NN available. + for (int i = 1; i < NUM_NNS; i++) { + cluster.restartNameNode(i, false); + } + cluster.waitClusterUp(); + + cluster.transitionToActive(0); + cluster.transitionToStandby(1); + + HATestUtil.waitForCheckpoint(cluster, 1, ImmutableList.of(12)); + + Thread.sleep(3000); + Long snnCheckpointTime1 = StandbyCheckpointer.getLastCheckpointTime(); + long annCheckpointTime1 = nns[0].getFSImage().getStorage().getMostRecentCheckpointTime(); + + doEdits(11, 20); + nns[0].getRpcServer().rollEditLog(); + + HATestUtil.waitForCheckpoint(cluster, 1, ImmutableList.of(23)); + Thread.sleep(3000); + Long snnCheckpointTime2 = StandbyCheckpointer.getLastCheckpointTime(); + long annCheckpointTime2 = nns[0].getFSImage().getStorage().getMostRecentCheckpointTime(); + + // Make sure the interv Review Comment: something is missing here -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org