szetszwo commented on code in PR #9796:
URL: https://github.com/apache/ozone/pull/9796#discussion_r2854408068


##########
hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto:
##########
@@ -2355,6 +2357,67 @@ message DeleteObjectTaggingRequest {
 message DeleteObjectTaggingResponse {
 }
 
+enum ReadConsistencyProto {
+  // Unspecified consistency, the read consistency behavior is decided
+  // by the OM
+  UNSPECIFIED = 0;

Review Comment:
   <img width="755" height="348" alt="image" 
src="https://github.com/user-attachments/assets/b600d2a1-6f66-40fa-a732-2ce557f19875";
 />
   Just realized that UNSPECIFIED only can be used once.  Let's use 
READ_CONSISTENCY_UNSPECIFIED



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerRatisServer.java:
##########
@@ -514,10 +516,29 @@ private RaftClientRequest createRaftRequestImpl(OMRequest 
omRequest, boolean isW
         .setMessage(
             Message.valueOf(
                 OMRatisHelper.convertRequestToByteString(omRequest)))
-        .setType(isWrite ? RaftClientRequest.writeRequestType() : 
RaftClientRequest.readRequestType())
+        .setType(isWrite ? RaftClientRequest.writeRequestType() : 
getRaftReadRequestType(omRequest))
         .build();
   }
 
+  private static RaftClientRequest.Type getRaftReadRequestType(OMRequest 
omRequest) {
+    if (!omRequest.hasReadConsistencyHint() || 
!omRequest.getReadConsistencyHint().hasReadConsistency() ||
+        omRequest.getReadConsistencyHint().getReadConsistency() == 
ReadConsistencyProto.UNSPECIFIED) {

Review Comment:
   Add a util method.  Use it here and also 
OzoneManagerProtocolServerSideTranslatorPB.
   ```java
   //OmUtils
     public static boolean specifiedReadConsistency(OMRequest request) {
       return request.hasReadConsistencyHint()
           && request.getReadConsistencyHint().hasReadConsistency()
           && request.getReadConsistencyHint().getReadConsistency() != 
UNSPECIFIED;
     }
   ```



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