ivandika3 commented on code in PR #9682:
URL: https://github.com/apache/ozone/pull/9682#discussion_r2739355102


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OMRatisHelper.java:
##########
@@ -64,14 +64,14 @@ public static OMResponse 
convertByteStringToOMResponse(ByteString bytes) throws
   }
 
   /** Convert the given reply with proto 3 {@link ByteString} to a proto 2 
response. */
-  public static OMResponse getOMResponseFromRaftClientReply(RaftClientReply 
reply) throws IOException {
+  public static OMResponse getOMResponseFromRaftClientReply(RaftClientReply 
reply, String leaderOMNodeId)
+      throws IOException {
     final OMResponse response = 
convertByteStringToOMResponse(reply.getMessage().getContent());
-    if (reply.getReplierId().equals(response.getLeaderOMNodeId())) {
-      return response;
+    OMResponse.Builder omResponse = OMResponse.newBuilder(response);
+    if (leaderOMNodeId != null) {
+      omResponse.setLeaderOMNodeId(leaderOMNodeId);
     }
-    return OMResponse.newBuilder(response)
-        .setLeaderOMNodeId(reply.getReplierId())
-        .build();
+    return omResponse.build();

Review Comment:
   Thanks, updated. 



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