[
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.
- Checked the test that the read-from-follower client only talked to a that
follower and there were no failovers.
- This is a compatible change:
-- Old client -> New server: the old client sends a normal watch request to
the new server. It will be processed normally.
-- New client -> Old server: the new client sends a DUMMY watch request to the
old server. The DUMMY message will be ignored and the watch request will be
processed as a normal watch request.
----
(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:
- 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.
> 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.
> - Checked the test that the read-from-follower client only talked to a that
> follower and there were no failovers.
> - This is a compatible change:
> -- Old client -> New server: the old client sends a normal watch request to
> the new server. It will be processed normally.
> -- New client -> Old server: the new client sends a DUMMY watch request to
> the old server. The DUMMY message will be ignored and the watch request
> will be processed as a normal watch request.
>
> ----
>
> (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)