[ 
https://issues.apache.org/jira/browse/HDDS-1909?focusedWorklogId=305843&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-305843
 ]

ASF GitHub Bot logged work on HDDS-1909:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Sep/19 20:04
            Start Date: 03/Sep/19 20:04
    Worklog Time Spent: 10m 
      Work Description: arp7 commented on pull request #1225: HDDS-1909. Use 
new HA code for Non-HA in OM.
URL: https://github.com/apache/hadoop/pull/1225#discussion_r320453906
 
 

 ##########
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/protocolPB/OzoneManagerProtocolServerSideTranslatorPB.java
 ##########
 @@ -115,7 +119,36 @@ public OMResponse submitRequest(RpcController controller,
           }
         }
       } else {
-        return submitRequestDirectlyToOM(request);
+        OMClientResponse omClientResponse = null;
+        long index = 0L;
+        try {
+          OMClientRequest omClientRequest =
+              OzoneManagerRatisUtils.createClientRequest(request);
+          if (omClientRequest != null) {
+            request = omClientRequest.preExecute(ozoneManager);
+            index = transactionIndex.incrementAndGet();
+            omClientRequest =
+                OzoneManagerRatisUtils.createClientRequest(request);
+            omClientResponse =
+                omClientRequest.validateAndUpdateCache(ozoneManager, index,
+                    ozoneManagerDoubleBuffer::add);
+          } else {
+            return submitRequestDirectlyToOM(request);
+          }
+        } catch(IOException ex) {
+          // As some of the preExecute returns error. So handle here.
+          return createErrorResponse(request, ex);
+        }
+
+        try {
+          omClientResponse.getFlushFuture().get();
+          LOG.trace("Future for {} is completed", request);
+        } catch (ExecutionException | InterruptedException ex) {
+          // Do we need to terminate OM here?
 
 Review comment:
   Yes I would err on the side of safety and self-terminate the OM here.
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 305843)
    Time Spent: 16h 10m  (was: 16h)

> Use new HA code for Non-HA in OM
> --------------------------------
>
>                 Key: HDDS-1909
>                 URL: https://issues.apache.org/jira/browse/HDDS-1909
>             Project: Hadoop Distributed Data Store
>          Issue Type: New Feature
>            Reporter: Bharat Viswanadham
>            Assignee: Bharat Viswanadham
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 16h 10m
>  Remaining Estimate: 0h
>
> This Jira is to use new HA code of OM in Non-HA code path.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to