ss77892 commented on code in PR #10985:
URL: https://github.com/apache/ozone/pull/10985#discussion_r3900327532


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisServer.java:
##########
@@ -145,6 +163,97 @@ public void testStartOMRatisServer() throws Exception {
         "Ratis Server should be in running state");
   }
 
+  /**
+   * HDDS-13621: a failed Raft reply in RetryCache must not be converted via
+   * getOMResponse (no response message), so checkRetryCache returns null.
+   */
+  @Test
+  public void checkRetryCacheReturnsNullWhenCachedReplyFailed() throws 
Exception {
+    when(ozoneManager.isTestSecureOmFlag()).thenReturn(true);
+    ClientId ratisClientId = ClientId.randomId();
+    int callId = 42;
+    RaftGroupMemberId memberId = RaftGroupMemberId.valueOf(
+        omRatisServer.getRaftPeerId(), 
omRatisServer.getRaftGroup().getGroupId());
+    RaftClientReply failedReply = RaftClientReply.newBuilder()
+        .setClientId(ratisClientId)
+        .setServerId(memberId)
+        .setGroupId(omRatisServer.getRaftGroup().getGroupId())
+        .setCallId(callId)
+        .setSuccess(false)
+        .setMessage(Message.EMPTY)

Review Comment:
   Original problem was with the null message. EMPTY wouldn't cause NPE if I 
remember correctly. So we should not set message at all.  



-- 
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]

Reply via email to