sadanand48 commented on code in PR #10118:
URL: https://github.com/apache/ozone/pull/10118#discussion_r3135722232
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java:
##########
@@ -933,6 +933,81 @@ public void testInstallSnapshotWithClientRead() throws
Exception {
assertLogCapture(logCapture, "Install Checkpoint is finished");
}
+ @Test
+ public void testInstallSnapshotOzoneManagerNotInRunningState() throws
Exception {
+ // Get the leader OM
+ final String leaderOMNodeId =
OmTestUtil.getCurrentOmProxyNodeId(objectStore);
+
+ OzoneManager leaderOM = cluster.getOzoneManager(leaderOMNodeId);
+ OzoneManagerRatisServer leaderRatisServer = leaderOM.getOmRatisServer();
+
+ // Find the inactive OM
+ String followerNodeId = leaderOM.getPeerNodes().get(0).getNodeId();
+ if (cluster.isOMActive(followerNodeId)) {
+ followerNodeId = leaderOM.getPeerNodes().get(1).getNodeId();
+ }
+ OzoneManager followerOM = cluster.getOzoneManager(followerNodeId);
+
+ // Do some transactions so that the log index increases
+ List<String> keys = writeKeysToIncreaseLogIndex(leaderRatisServer, 200);
+
+ // Get transaction Index
+ TransactionInfo transactionInfo =
+ TransactionInfo.readTransactionInfo(leaderOM.getMetadataManager());
+ TermIndex leaderOMTermIndex =
+ TermIndex.valueOf(transactionInfo.getTerm(),
+ transactionInfo.getTransactionIndex());
+ long leaderOMSnapshotIndex = leaderOMTermIndex.getIndex();
+ long leaderOMSnapshotTermIndex = leaderOMTermIndex.getTerm();
+
+ // Start the inactive OM. Checkpoint installation will happen
spontaneously.
+ cluster.startInactiveOM(followerNodeId);
+ OzoneManager.setTestInstallSnapshot(true);
+ LogCapturer logCapture = LogCapturer.captureLogs(OzoneManager.class);
+ assertLogCapture(logCapture, "OzoneManager is not in running state");
+ OzoneManager.setTestInstallSnapshot(false);
Review Comment:
minor nit:
```suggestion
GenericTestUtils.waitFor(followerOM::isRunning, 100, 30_000);
OzoneManager.setTestInstallSnapshot(false);
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]