szetszwo commented on code in PR #9319:
URL: https://github.com/apache/ozone/pull/9319#discussion_r2563760312
##########
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:
> I’m not sure how Ratis handles read requests internally, but a safe and
efficient approach would be:
@peterxcli , this is the `LinearizableRead` implemented by Ratis.
--
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]