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


##########
ratis-server/src/main/java/org/apache/ratis/server/raftlog/LogProtoUtils.java:
##########
@@ -137,8 +137,9 @@ public static LogEntryProto 
removeStateMachineData(LogEntryProto entry) {
   }
 
   private static LogEntryProto 
replaceStateMachineDataWithSerializedSize(LogEntryProto entry) {
-    return replaceStateMachineEntry(entry,
+    LogEntryProto replaced = replaceStateMachineEntry(entry,
         
StateMachineEntryProto.newBuilder().setLogEntryProtoSerializedSize(entry.getSerializedSize()));
+    return copy(replaced);

Review Comment:
   @symious , `replaced` is built by replacing some parts (i.e. 
`StateMachineEntryProto`) of the `LogEntryProto` .  The remaining parts need to 
be copied.



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