You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/11/23 02:19:00 UTC

[jira] [Commented] (HDFS-17263) RBF: Fix client ls trash path cannot get except default nameservices trash path

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

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

LiuGuH commented on code in PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#discussion_r1402860528


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MountTableResolver.java:
##########
@@ -357,7 +357,7 @@ public void refreshEntries(final Collection<MountTable> entries) {
   @VisibleForTesting
   public static boolean isTrashPath(String path) throws IOException {
     Pattern pattern = Pattern.compile(
-        "^" + getTrashRoot() + TRASH_PATTERN + "/");
+        "^" + getTrashRoot() + TRASH_PATTERN);

Review Comment:
   Fox example , If we don't remove / , client executes command:  ls /user/*/.Trash/Current, it will only return the defalut nameservice  trash path.   
   The test case is in org.apache.hadoop.hdfs.server.federation.router.TestRouterTrash#testMultipleMountPoint , 
   ` FileStatus[] fileStatuses = fs.listStatus(new Path("/user/test-trash/.Trash/Current/"));
       assertEquals(3, fileStatuses.length);`
   If we don't remove / , fileStatuses.length will be 1.
   Thanks.
   





> RBF: Fix client ls trash path cannot get except default nameservices trash path
> -------------------------------------------------------------------------------
>
>                 Key: HDFS-17263
>                 URL: https://issues.apache.org/jira/browse/HDFS-17263
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: liuguanghua
>            Priority: Major
>              Labels: pull-request-available
>
> With  HDFS-16024, we can rename data to the Trash should be based on src locations. That is great for my useage.  After a period of use, I found this cause a issue.
> There are two nameservices ns0   ns1,  and ns0 is the default nameservice.
> (1) Add moutTable 
> /home/data -> (ns0, /home/data)
> /data1/test1 -> (ns1, /data1/test1 )
> /data2/test2 -> (ns1, /data2/test2 )
> (2)mv file to trash
> ns0:   /user/test-user/.Trash/Current/home/data/file1
> ns1:   /user/test-user/.Trash/Current/data1/test1/file1
> (3) client via DFSRouter  ls will not see  /user/test-user/.Trash/Current/data1
> (4) client ls  /user/test-user/.Trash/Current/data2/test2 will return exception .
>  
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org