ivandika3 commented on code in PR #1438:
URL: https://github.com/apache/ratis/pull/1438#discussion_r3121316750
##########
ratis-client/src/main/java/org/apache/ratis/client/impl/AsyncImpl.java:
##########
@@ -40,7 +40,7 @@ class AsyncImpl implements AsyncRpcApi {
CompletableFuture<RaftClientReply> send(
RaftClientRequest.Type type, Message message, RaftPeerId server) {
return TraceClient.asyncSend(
- () -> client.getOrderedAsync().send(type, message, server), type,
server);
+ () -> client.getOrderedAsync(server).send(type, message, server),
type, server);
Review Comment:
Currently, if the `server` is not a leader, it will throw
`NotLeaderException` since `watchAsync` calls `checkLeaderState`. This might
cause `AsyncStreamObservers#completeReplyExceptionally` which will trigger
client to invalidate all the pending replies.
One idea is to allow follower to accept the watch request if the
RaftClientRequest serverId matches, but currently `WatchRequests` is stored in
the `LeaderStateImpl`. So we might want to make `WATCH(0)` to be a special
"bootstrap" request that can be handled by follower, otherwise the watch should
throw `NotLeaderException` to preserve the watch semantics.
Also, could you help to add some tests to test to behavior similar to
https://github.com/apache/ratis/pull/1433? Set the dummy request to true for
`LinearizableReadTests` should be enough.
--
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]