[
https://issues.apache.org/jira/browse/RATIS-2497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tsz-wo Sze updated RATIS-2497:
------------------------------
Description:
- Revised Description:
We add a DUMMY message to the watch request. The server can detects it and
skips leader check.
---- - Previous Title:
Implement OrderedAsync improvement to remove dummy request
- Previous Description:
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.
was:
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.
Summary: Pass server to the dummy watch request in OrderedAsync (was:
Implement OrderedAsync improvement to remove dummy request)
> Pass server to the dummy watch request in OrderedAsync
> ------------------------------------------------------
>
> Key: RATIS-2497
> URL: https://issues.apache.org/jira/browse/RATIS-2497
> Project: Ratis
> Issue Type: Improvement
> Components: client
> Reporter: Ivan Andika
> Assignee: Tsz-wo Sze
> Priority: Major
> Fix For: 3.3.0
>
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> - Revised Description:
> We add a DUMMY message to the watch request. The server can detects it and
> skips leader check.
> ---- - Previous Title:
> Implement OrderedAsync improvement to remove dummy request
> - Previous Description:
> 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)