szetszwo commented on code in PR #1721:
URL: https://github.com/apache/ratis/pull/1721#discussion_r4789555356


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/ServerProtoUtils.java:
##########
@@ -66,16 +66,17 @@ static RequestVoteRequestProto toRequestVoteRequestProto(
   }
 
   static StartLeaderElectionReplyProto toStartLeaderElectionReplyProto(
-      RaftPeerId requestorId, RaftGroupMemberId replyId, boolean success) {
+      RaftPeerId requestorId, RaftGroupMemberId replyId, boolean success, long 
callId) {

Review Comment:
   In order to be consistent with ClientProtoUtils.toRaftRpcReplyProtoBuilder, 
let's swap success and callId, i.e. 
   ```java
     static StartLeaderElectionReplyProto toStartLeaderElectionReplyProto(
         RaftPeerId requestorId, RaftGroupMemberId replyId, long callId, 
boolean success) {
   ```



##########
ratis-server/src/main/java/org/apache/ratis/server/impl/ServerProtoUtils.java:
##########
@@ -66,16 +66,17 @@ static RequestVoteRequestProto toRequestVoteRequestProto(
   }
 
   static StartLeaderElectionReplyProto toStartLeaderElectionReplyProto(
-      RaftPeerId requestorId, RaftGroupMemberId replyId, boolean success) {
+      RaftPeerId requestorId, RaftGroupMemberId replyId, boolean success, long 
callId) {
     return StartLeaderElectionReplyProto.newBuilder()
-        .setServerReply(toRaftRpcReplyProtoBuilder(requestorId, replyId, 
success))
+        .setServerReply(toRaftRpcReplyProtoBuilder(requestorId, replyId, 
success).setCallId(callId))

Review Comment:
   ```java
      private static RaftRpcReplyProto.Builder toRaftRpcReplyProtoBuilder(
   -      RaftPeerId requestorId, RaftGroupMemberId replyId, boolean success) {
   +      RaftPeerId requestorId, RaftGroupMemberId replyId, Long callId, 
boolean success) {
        return ClientProtoUtils.toRaftRpcReplyProtoBuilder(
   -        requestorId.toByteString(), replyId.getPeerId().toByteString(), 
replyId.getGroupId(), null, success);
   +        requestorId.toByteString(), replyId.getPeerId().toByteString(), 
replyId.getGroupId(), callId, success);
      }
   ```
   - Let's add a callId parameter to toRaftRpcReplyProtoBuilder, which 
currently pass null callId to ClientProtoUtils.toRaftRpcReplyProtoBuilder as 
above.
   - For the other rpcs such as toInstallSnapshotReplyProto and 
toReadIndexReplyProto, they probably have a similar bug.  See if you would fix 
it here or we can fix it separately.  (we can pass null as the callId parameter 
for now)



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

Reply via email to