[
https://issues.apache.org/jira/browse/HDDS-1175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17260158#comment-17260158
]
runzhiwang edited comment on HDDS-1175 at 1/7/21, 2:23 AM:
-----------------------------------------------------------
[~bharat] Hi, I have one question, sorry for that.
Why not process read only request via ratis, then we can add isLeaderReady()
check in the following ratis code. If so, the change will be transparent for
OM, OM does not need to care about this. Besides, in the future, if follower OM
wants to support read only request, it's also easy via ratis: follower need to
ask for commitIndex from leader, then follower wait (applyIndex of follower) >=
(commitIndex from leader), then follower server read only request. Just a
discussion, sorry for that.
{code:java}
if (type.is(TypeCase.READ)) {
// TODO: We might not be the leader anymore by the time this completes.
// See the RAFT paper section 8 (last part)
replyFuture =
processQueryFuture(stateMachine.query(request.getMessage()), request);
}
{code}
was (Author: yjxxtd):
[~bharat] Hi, I have one question, sorry for that.
Why not process read only request via ratis, then we can add isLeaderReady()
check in the following ratis code. If so, the change will be transparent for
OM, OM does not need to care about this. Besides, in the future, if follower OM
wants to support read only request, it's also easy via ratis, follower need to
ask for commitIndex from leader, then follower wait (applyIndex of follower) >=
(commitIndex from leader), then follower server read only request. Just a
discussion, sorry for that.
{code:java}
if (type.is(TypeCase.READ)) {
// TODO: We might not be the leader anymore by the time this completes.
// See the RAFT paper section 8 (last part)
replyFuture =
processQueryFuture(stateMachine.query(request.getMessage()), request);
}
{code}
> Serve read requests directly from RocksDB
> -----------------------------------------
>
> Key: HDDS-1175
> URL: https://issues.apache.org/jira/browse/HDDS-1175
> Project: Hadoop Distributed Data Store
> Issue Type: Sub-task
> Components: OM HA, Ozone Manager
> Reporter: Hanisha Koneru
> Assignee: Hanisha Koneru
> Priority: Major
> Labels: pull-request-available
> Attachments: HDDS-1175.001.patch
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> We can directly server read requests from the OM's RocksDB instead of going
> through the Ratis server. OM should first check its role and only if it is
> the leader can it server read requests.
> There can be a scenario where an OM can lose its Leader status but not know
> about the new election in the ring. This OM could server stale reads for the
> duration of the heartbeat timeout but this should be acceptable (similar to
> how Standby Namenode could possibly server stale reads till it figures out
> the new status).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]