szetszwo commented on code in PR #1624:
URL: https://github.com/apache/ratis/pull/1624#discussion_r4167818225
##########
ratis-client/src/main/java/org/apache/ratis/client/impl/RaftClientImpl.java:
##########
@@ -362,6 +367,8 @@ RaftClientReply handleReply(RaftClientRequest request,
RaftClientReply reply) {
if (request.isToLeader() && reply != null) {
if (!request.getType().isReadOnly()) {
repliedCallIds.add(reply.getCallId());
+ } else {
+ repliedCallIds.removeSent(request.getCallId());
Review Comment:
If we removeSent, the corresponding reply id set will be ignored. Let's
don't add it at the first place.
```diff
+++
b/ratis-client/src/main/java/org/apache/ratis/client/impl/RaftClientImpl.java
@@ -289,8 +289,10 @@ public final class RaftClientImpl implements RaftClient
{
if (server != null) {
b.setServerId(server);
} else {
- b.setLeaderId(getLeaderId())
- .setRepliedCallIds(repliedCallIds.get(callId));
+ b.setLeaderId(getLeaderId());
+ if (!type.isReadOnly()) {
+ b.setRepliedCallIds(repliedCallIds.get(callId));
+ }
}
if (TraceUtils.isEnabled()) {
b.setSpanContext(TraceUtils.injectContextToProto());
```
--
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]