ivandika3 commented on code in PR #5288:
URL: https://github.com/apache/ozone/pull/5288#discussion_r1521047545


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java:
##########
@@ -243,6 +243,10 @@ private OMResponse submitRequestToRatis(OMRequest request)
 
   private OMResponse submitReadRequestToOM(OMRequest request)
       throws ServiceException {
+    // Read from leader or followers using linearizable read
+    if (omRatisServer.isLinearizableRead()) {
+      return handler.handleReadRequest(request);
+    }

Review Comment:
   Please correct me if I am wrong, but 
`OzoneManagerRequestHandler#handleReadRequest` queries the OM metadata tables 
directly without going through Ratis (`OzoneManagerStateMachine#query`). This 
might cause OM to incorrectly read follower stale data. From my understanding, 
linearizable read should only work if a request is sent to the OM Ratis server 
(just like `OzoneManagerRatisServer#submitRequest`). 
   
   Just some question regarding OM consistency: currently (before linearizable 
read) since reads and writes must goes through the leader, does OM provides a 
"read-after-write" consistency (or is it stronger?) even through the read does 
not go through Ratis server? If we enable linearizable read we can increase the 
consistency guarantee to "linearizable"?
   
   Reference: Jepsen consistency model (https://jepsen.io/consistency)
   



-- 
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]

Reply via email to