sumitagrawl commented on code in PR #8059:
URL: https://github.com/apache/ozone/pull/8059#discussion_r1996968667


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java:
##########
@@ -173,43 +171,13 @@ private OMResponse internalProcessRequest(OMRequest 
request) throws ServiceExcep
         return cached;
       }
 
-      // process new request
-      OMClientRequest omClientRequest = null;
-      final OMRequest requestToSubmit;
-      try {
-        omClientRequest = createClientRequest(request, ozoneManager);
-        // TODO: Note: Due to HDDS-6055, createClientRequest() could now
-        //  return null, which triggered the findbugs warning.
-        //  Added the assertion.
-        assert (omClientRequest != null);
-        OMClientRequest finalOmClientRequest = omClientRequest;
-
-        requestToSubmit = preExecute(finalOmClientRequest);
-        this.lastRequestToSubmit = requestToSubmit;
-      } catch (IOException ex) {
-        if (omClientRequest != null) {
-          OMAuditLogger.log(omClientRequest.getAuditBuilder());
-          omClientRequest.handleRequestFailure(ozoneManager);
-        }
-        return createErrorResponse(request, ex);
-      }
-
-      final OMResponse response = omRatisServer.submitRequest(requestToSubmit);
-      if (!response.getSuccess()) {
-        omClientRequest.handleRequestFailure(ozoneManager);
-      }
-      return response;
+      this.lastRequestToSubmit = request;
+      return ozoneManager.getOmGateway().submit(request);

Review Comment:
   Here, (1) does preexecute which is just validation
   (2) update `lastRequestToSubmit` , so still request is not yet completed
   (3) perform ratis submit to execute
   
   So, (2) moving before (1) has no impact as done in this PR.
   
   Old flow:
           requestToSubmit = preExecute(finalOmClientRequest);    <--- (1)
           this.lastRequestToSubmit = requestToSubmit;                    <--- 
(2)
         } catch (IOException ex) {
             ...
         }
   
        final OMResponse response = 
omRatisServer.submitRequest(requestToSubmit);     <-- (3)



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