symious commented on code in PR #9319:
URL: https://github.com/apache/ozone/pull/9319#discussion_r2563880926
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java:
##########
@@ -184,12 +184,12 @@ public OMRequest getLastRequestToSubmit() {
private OMResponse submitReadRequestToOM(OMRequest request)
throws ServiceException {
+ // Get current OM's role
+ RaftServerStatus raftServerStatus = omRatisServer.getLeaderStatus();
// Read from leader or followers using linearizable read
- if (omRatisServer.isLinearizableRead()) {
+ if (omRatisServer.isLinearizableRead() && raftServerStatus == NOT_LEADER) {
Review Comment:
@szetszwo The example is valid, but it feels like Ratis places too many
restrictions on the leader.
The probability of a leader returning stale committed data is actually very
small, and forcing the leader to constantly prove its leadership makes the
system slower — which in practice increases the chance of stale reads more than
the original issue itself.
In other words, the “extra safety” ends up hurting availability and
performance more than it helps.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]