szetszwo commented on code in PR #913:
URL: https://github.com/apache/ratis/pull/913#discussion_r1315151038
##########
ratis-client/src/main/java/org/apache/ratis/client/impl/AsyncImpl.java:
##########
@@ -53,7 +53,7 @@ public CompletableFuture<RaftClientReply>
sendReadOnly(Message message, RaftPeer
@Override
public CompletableFuture<RaftClientReply> sendReadAfterWrite(Message
message) {
- return send(RaftClientRequest.readAfterWriteConsistentRequestType(),
message, null);
+ return
UnorderedAsync.send(RaftClientRequest.readAfterWriteConsistentRequestType(),
message, null, client);
Review Comment:
Sorry, it actually not working since `UnorderedAsync` use a different
channel. It can arrive the server earlier than the previous write request and
get a small readIndex. `TestReadAfterWrite` will fail.
- Using unordered async
```
2023-09-04 11:16:59,888 DEBUG server.RaftServer$Division
(LeaderStateImpl.java:getReadIndex(1099)) - readIndex=1,
readAfterWriteConsistentIndex=1
```
- Using ordered async
```
2023-09-04 11:11:36,917 DEBUG server.RaftServer$Division
(LeaderStateImpl.java:getReadIndex(1099)) - readIndex=3,
readAfterWriteConsistentIndex=3
```
--
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]