ivandika3 commented on code in PR #1362:
URL: https://github.com/apache/ratis/pull/1362#discussion_r3003594675


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -1218,7 +1241,15 @@ private boolean checkLeaderLease() {
   }
 
   void replyPendingRequest(TermIndex termIndex, RaftClientReply reply) {
-    pendingRequests.replyPendingRequest(termIndex, reply);
+    if (readIndexType == Type.REPLIED_INDEX) {
+      // Remove from pending map but hold the reply for batch flushing.
+      final PendingRequest pending = 
pendingRequests.removePendingRequest(termIndex);
+      if (pending != null) {
+        replyFlusher.hold(pending, reply, termIndex.getIndex());

Review Comment:
   Thank you, good catch!



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