[ 
https://issues.apache.org/jira/browse/RATIS-2497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ivan Andika updated RATIS-2497:
-------------------------------
    Summary: Implement OrderedAsync improvement to remove dummy request  (was: 
Implement dummy request as a noop request instead of watch request)

> Implement OrderedAsync improvement to remove dummy request
> ----------------------------------------------------------
>
>                 Key: RATIS-2497
>                 URL: https://issues.apache.org/jira/browse/RATIS-2497
>             Project: Ratis
>          Issue Type: Improvement
>            Reporter: Ivan Andika
>            Assignee: Ivan Andika
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently the dummy request is a WATCH(0) which will trigger client leader 
> failover. In a follower read client scenario, this might cause client to 
> always failover to the leader which reduces the follower read effectiveness.
> {code:java}
> static OrderedAsync newInstance(RaftClientImpl client, RaftProperties 
> properties) {
>     final OrderedAsync ordered = new OrderedAsync(client, properties);
>     // send a dummy watch request to establish the connection
>     // TODO: this is a work around, it is better to fix the underlying RPC 
> implementation
>     if (RaftClientConfigKeys.Async.Experimental.sendDummyRequest(properties)) 
> {
>       ordered.send(RaftClientRequest.watchRequestType(), null, null);
>     }
>     return ordered;
>   }
> {code}
> One solution implement a new noop request (some kind of ping request) which 
> simply returns a successful response regardless of the Raft peer role.
> However, it might be better to address the long term TODO by fixing the 
> underlying RPC implementation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to