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

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

Neilxzn commented on code in PR #5184:
URL: https://github.com/apache/hadoop/pull/5184#discussion_r1040597476


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:
##########
@@ -702,8 +702,9 @@ public boolean truncate(String src, long newLength, String 
clientName)
     RemoteMethod method = new RemoteMethod("truncate",
         new Class<?>[] {String.class, long.class, String.class},
         new RemoteParam(), newLength, clientName);
+    // Truncate can return true/false, so don't expect a result

Review Comment:
   SetReplication API has the same issue. I think `setReplication` API should 
call  `rpcClient.invokeAll(locations, method)` like `delete` API.  I have fix 
it in next commit. Please review it again.





> RBF. Truncate API always fails when dirs use AllResolver oder on Router  
> -------------------------------------------------------------------------
>
>                 Key: HDFS-16861
>                 URL: https://issues.apache.org/jira/browse/HDFS-16861
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: rbf
>    Affects Versions: 3.4.0
>            Reporter: Max  Xie
>            Assignee: Max  Xie
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: image-2022-12-05-17-35-19-841.png
>
>
> # prepare a directory in a HASH_ALL/SPACE/RANDOM mount point.
>  # put  a test file with 1024 bytes  to this directory
>  # truncate the file with 100 new length  and this op will fail and throw  a 
> exception that the file does not exist.
>  
> After dig it, we should ignore the result of Truncate API in 
> RouterClientProtocol because
> Truncate can return true/false, so don't expect a result.
> After fix it , the code is 
> !image-2022-12-05-17-35-19-841.png!
>  



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