xiaoyuyao 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_r306016722
##########
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:
Should we stop the omRatisServer after the test?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]