avijayanhwx commented on a change in pull request #1664:
URL: https://github.com/apache/ozone/pull/1664#discussion_r537894381
##########
File path:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java
##########
@@ -266,61 +233,23 @@ private void writeTestData(ObjectStore store, String
volumeName,
keyStream.close();
}
- private OMRequest buildPrepareRequest() {
- PrepareRequest requestProto = PrepareRequest.newBuilder().build();
-
- return OMRequest.newBuilder()
- .setPrepareRequest(requestProto)
- .setCmdType(Type.Prepare)
- .setClientId(UUID.randomUUID().toString())
- .build();
- }
-
private void waitAndCheckPrepared(OzoneManager om,
long prepareRequestLogIndex) throws Exception {
// Log files are deleted after the snapshot is taken,
// So once log files have been deleted, OM should be prepared.
LambdaTestUtils.await(timeoutMillis, 1000,
() -> !logFilesPresentInRatisPeer(om));
- checkPrepared(om, prepareRequestLogIndex);
+ Assert.assertTrue(checkPrepared(om, prepareRequestLogIndex));
}
- private void checkPrepared(OzoneManager om, long prepareRequestLogIndex)
+ private boolean checkPrepared(OzoneManager om, long prepareRequestLogIndex)
Review comment:
Due to my last comment, this still has one usage.
##########
File path:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java
##########
@@ -217,15 +188,11 @@ public void testPrepareDownedOM() throws Exception {
// Since prepare was the last Ratis transaction, it should have all data
// it missed once it receives the prepare transaction.
cluster.restartOzoneManager(downedOM, true);
- // Wait for other OMs to catch this one up on transactions.
- LambdaTestUtils.await(timeoutMillis, 1000,
- () -> downedOM.getRatisSnapshotIndex() == prepareIndex);
- checkPrepared(downedOM, prepareIndex);
+ LambdaTestUtils.await(timeoutMillis, 2000,
+ () -> checkPrepared(downedOM, prepareIndex));
Review comment:
Given that we have already made sure that there are no logs present in
the functional OMs, I believe that it is sufficient to check just the prepare
request apply marker in the downed OM.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]