szetszwo commented on code in PR #1362:
URL: https://github.com/apache/ratis/pull/1362#discussion_r2969937013
##########
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:
Found a bug that we should also withhold completing the cacheEntry.
Otherwise, the retries can get the cached reply.
--
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]