[ 
https://issues.apache.org/jira/browse/HDFS-17922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18081283#comment-18081283
 ] 

ASF GitHub Bot commented on HDFS-17922:
---------------------------------------

dParikesit opened a new pull request, #8500:
URL: https://github.com/apache/hadoop/pull/8500

   ### Description of PR
   
   JIRA: [HDFS-17922](https://issues.apache.org/jira/browse/HDFS-17922)
   
   In RouterAsyncClientProtocol:rename2, there is a path that returns 
synchronously if we have empty locations `if (locs.isEmpty)`.
   ```
   @Override
     public void rename2(
         final String src, final String dst,
         final Options.Rename... options) throws IOException {
       ...
       if (locs.isEmpty()) {
         rbfRename.routerFedRename(src, dst, srcLocations, dstLocations);
         // Missing async handling
         return;
       }
       ...
       asyncApply((AsyncApplyFunction<Boolean, Boolean>) isMultiDestDirectory 
-> {
         if (isMultiDestDirectory) {
           ...
           rpcClient.invokeConcurrent(locs, method);
         } else {
           rpcClient.invokeSequential(locs, method, null, null);
         }
       });
     }
   ```
   There are other paths that behave similarly, such as msync()
   ```
   @Override
     public void msync() throws IOException {
       rpcServer.checkOperation(NameNode.OperationCategory.READ, true);
       ...
       if (namespacesEligibleForObserverReads.isEmpty()) {
         asyncCompleteWith(CompletableFuture.completedFuture(null));
         return;
       }
       rpcClient.invokeConcurrent(namespacesEligibleForObserverReads, method);
     } 
   ```
   
   We propose to add a patch to add `asyncComplete(null);` before the return.
   
   ### How was this patch tested?
   ```
   mvn -am -pl hadoop-hdfs-project/hadoop-hdfs-rbf 
-Dtest=TestRouterAsyncFederationRename test
   ```




> rename2 in the router asynchronous RPC is missing an async path
> ---------------------------------------------------------------
>
>                 Key: HDFS-17922
>                 URL: https://issues.apache.org/jira/browse/HDFS-17922
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Dimas Shidqi Parikesit
>            Priority: Major
>
> In RouterAsyncClientProtocol:rename2, there is a path that returns 
> synchronously if we have empty locations `if (locs.isEmpty)`.
> {code:java}
> @Override
>   public void rename2(
>       final String src, final String dst,
>       final Options.Rename... options) throws IOException {
>     ...
>     if (locs.isEmpty()) {
>       rbfRename.routerFedRename(src, dst, srcLocations, dstLocations);
>       // Missing async handling
>       return;
>     }
>     ...
>     asyncApply((AsyncApplyFunction<Boolean, Boolean>) isMultiDestDirectory -> 
> {
>       if (isMultiDestDirectory) {
>         ...
>         rpcClient.invokeConcurrent(locs, method);
>       } else {
>         rpcClient.invokeSequential(locs, method, null, null);
>       }
>     });
>   }{code}
>  
> There are other paths that behave similarly, such as msync()
> {code:java}
> @Override
>   public void msync() throws IOException {
>     rpcServer.checkOperation(NameNode.OperationCategory.READ, true);
>     ...
>     if (namespacesEligibleForObserverReads.isEmpty()) {
>       asyncCompleteWith(CompletableFuture.completedFuture(null));
>       return;
>     }
>     rpcClient.invokeConcurrent(namespacesEligibleForObserverReads, method);
>   } {code}
>  
> We propose to add a patch to add `asyncComplete(null);` before the return.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to