hanishakoneru commented on a change in pull request #1130: HDDS-1827. Load Snapshot info when OM Ratis server starts. URL: https://github.com/apache/hadoop/pull/1130#discussion_r314449239
########## File path: hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisServer.java ########## @@ -126,6 +130,24 @@ public void testStartOMRatisServer() throws Exception { LifeCycle.State.RUNNING, omRatisServer.getServerState()); } + @Test + public void testLoadSnapshotInfoOnStart() throws Exception { + // Stop the Ratis server and manually update the snapshotInfo. + long oldSnaphsotIndex = ozoneManager.saveRatisSnapshot(); + ozoneManager.getSnapshotInfo().saveRatisSnapshotToDisk(oldSnaphsotIndex); + omRatisServer.stop(); + long newSnapshotIndex = oldSnaphsotIndex + 100; + ozoneManager.getSnapshotInfo().saveRatisSnapshotToDisk(newSnapshotIndex); + + // Start new Ratis server. It should pick up and load the new SnapshotInfo + omRatisServer = OzoneManagerRatisServer.newOMRatisServer(conf, ozoneManager, + omNodeDetails, Collections.emptyList()); + omRatisServer.start(); Review comment: omRatisServer is stopped when shutdown() is executed. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org