You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "LiuGuH (via GitHub)" <gi...@apache.org> on 2023/11/22 08:17:55 UTC

[PR] HDFS-17263. [RBF] Fix client ls trash path cannot get except default nameservices trash path [hadoop]

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

   
   <!--
     Thanks for sending a pull request!
       1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
       2. Make sure your PR title starts with JIRA issue id, e.g., 'HADOOP-17799. Your PR title ...'.
   -->
   
   ### Description of PR
   https://issues.apache.org/jira/browse/HDFS-17263


-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "hadoop-yetus (via GitHub)" <gi...@apache.org>.
hadoop-yetus commented on PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#issuecomment-1831360476

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 20s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  |  The patch appears to include 1 new or modified test files.  |
   |||| _ trunk Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  32m 13s |  |  trunk passed  |
   | +1 :green_heart: |  compile  |   0m 24s |  |  trunk passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  compile  |   0m 21s |  |  trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  checkstyle  |   0m 18s |  |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   0m 25s |  |  trunk passed  |
   | +1 :green_heart: |  javadoc  |   0m 29s |  |  trunk passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  javadoc  |   0m 20s |  |  trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  spotbugs  |   0m 49s |  |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  19m 31s |  |  branch has no errors when building and testing our client artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   0m 20s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 17s |  |  the patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  javac  |   0m 17s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 16s |  |  the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  javac  |   0m 16s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  checkstyle  |   0m 12s |  |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   0m 18s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 16s |  |  the patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  javadoc  |   0m 17s |  |  the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  spotbugs  |   0m 46s |  |  the patch passed  |
   | +1 :green_heart: |  shadedclient  |  19m 12s |  |  patch has no errors when building and testing our client artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |  19m  5s |  |  hadoop-hdfs-rbf in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 24s |  |  The patch does not generate ASF License warnings.  |
   |  |   |  98m 42s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6291/3/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/6291 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
   | uname | Linux 8ae1bd879619 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/bin/hadoop.sh |
   | git revision | trunk / 434bfc42bcb6044a790425219ab3352eaa35cf98 |
   | Default Java | Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
   | Multi-JDK versions | /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
   |  Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6291/3/testReport/ |
   | Max. process+thread count | 2653 (vs. ulimit of 5500) |
   | modules | C: hadoop-hdfs-project/hadoop-hdfs-rbf U: hadoop-hdfs-project/hadoop-hdfs-rbf |
   | Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6291/3/console |
   | versions | git=2.25.1 maven=3.6.3 spotbugs=4.2.2 |
   | Powered by | Apache Yetus 0.14.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. [RBF] Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "LiuGuH (via GitHub)" <gi...@apache.org>.
LiuGuH commented on code in PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#discussion_r1404159749


##########
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:
   In  other word, if client listStatus trashpath like '/user/test-trash/.Trash/Current',  this is not consider a trash path
   `  
    if (isTrashPath(path)) {
        path = subtractTrashCurrentPath(path);
       }
   `
   
   And then it will not find any mountpoint for this trash path,and getDestinationForPath() only return defalut nameservice mountpoint
   
   ` public PathLocation getDestinationForPath(final String path)
        `



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. [RBF] Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "hadoop-yetus (via GitHub)" <gi...@apache.org>.
hadoop-yetus commented on PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#issuecomment-1822446504

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 20s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  |  The patch appears to include 1 new or modified test files.  |
   |||| _ trunk Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  31m 24s |  |  trunk passed  |
   | +1 :green_heart: |  compile  |   0m 22s |  |  trunk passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  compile  |   0m 19s |  |  trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  checkstyle  |   0m 18s |  |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   0m 28s |  |  trunk passed  |
   | +1 :green_heart: |  javadoc  |   0m 27s |  |  trunk passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  javadoc  |   0m 18s |  |  trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  spotbugs  |   0m 49s |  |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  19m 18s |  |  branch has no errors when building and testing our client artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   0m 17s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 19s |  |  the patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  javac  |   0m 19s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 18s |  |  the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  javac  |   0m 18s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | -0 :warning: |  checkstyle  |   0m 12s | [/results-checkstyle-hadoop-hdfs-project_hadoop-hdfs-rbf.txt](https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6291/1/artifact/out/results-checkstyle-hadoop-hdfs-project_hadoop-hdfs-rbf.txt) |  hadoop-hdfs-project/hadoop-hdfs-rbf: The patch generated 2 new + 3 unchanged - 0 fixed = 5 total (was 3)  |
   | +1 :green_heart: |  mvnsite  |   0m 19s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 17s |  |  the patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  javadoc  |   0m 17s |  |  the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  spotbugs  |   0m 50s |  |  the patch passed  |
   | +1 :green_heart: |  shadedclient  |  19m 31s |  |  patch has no errors when building and testing our client artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |  19m  6s |  |  hadoop-hdfs-rbf in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 23s |  |  The patch does not generate ASF License warnings.  |
   |  |   |  97m 58s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6291/1/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/6291 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
   | uname | Linux 9a3dae1b6386 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/bin/hadoop.sh |
   | git revision | trunk / aee72cfd8bdcf3374e22db26606a4b32320668cd |
   | Default Java | Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
   | Multi-JDK versions | /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
   |  Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6291/1/testReport/ |
   | Max. process+thread count | 2613 (vs. ulimit of 5500) |
   | modules | C: hadoop-hdfs-project/hadoop-hdfs-rbf U: hadoop-hdfs-project/hadoop-hdfs-rbf |
   | Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6291/1/console |
   | versions | git=2.25.1 maven=3.6.3 spotbugs=4.2.2 |
   | Powered by | Apache Yetus 0.14.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. [RBF] Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "LiuGuH (via GitHub)" <gi...@apache.org>.
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,only return  /user/test-trash/.Trash/Current/home. And
   client can not see  /user/test-trash/.Trash/Current/data1 and /user/test-trash/.Trash/Current/data2
   Thanks.
   



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. [RBF] Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "LiuGuH (via GitHub)" <gi...@apache.org>.
LiuGuH commented on code in PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#discussion_r1404159749


##########
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:
   In  other word, if client listStatus trashpath like '/user/test-trash/.Trash/Current',  this is not consider a trash path
   `   if (isTrashPath(path)) {
         path = subtractTrashCurrentPath(path);
       }`
   
   And then it will not find any mountpoint for this trash path,and only return defalut nameservice mountpoint
   
   ` public PathLocation getDestinationForPath(final String path)
         throws IOException {
       verifyMountTable();
       PathLocation res;
       readLock.lock();
       try {
         if (this.locationCache == null) {
           res = lookupLocation(processTrashPath(path));
         } else {
           Callable<? extends PathLocation> meh = (Callable<PathLocation>) () -> {
             this.getLocCacheMiss().increment();
             return lookupLocation(processTrashPath(path));
           };
           res = this.locationCache.get(processTrashPath(path), meh);
           this.getLocCacheAccess().increment();
         }
         if (isTrashPath(path)) {
           List<RemoteLocation> remoteLocations = new ArrayList<>();
           for (RemoteLocation remoteLocation : res.getDestinations()) {
             remoteLocations.add(new RemoteLocation(remoteLocation, path));
           }
           return new PathLocation(path, remoteLocations,
               res.getDestinationOrder());
         } else {
           return res;
         }
       } catch (ExecutionException e) {
         Throwable cause = e.getCause();
         final IOException ioe;
         if (cause instanceof IOException) {
           ioe = (IOException) cause;
         } else {
           ioe = new IOException(cause);
         }
         throw ioe;
       } finally {
         readLock.unlock();
       }
     }`



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#issuecomment-1833926153

   @LiuGuH Thank you for your contribution! @goiri @Hexiaoqiao Thank you very much for your help in reviewing the code!


-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "LiuGuH (via GitHub)" <gi...@apache.org>.
LiuGuH commented on code in PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#discussion_r1408780398


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterTrash.java:
##########
@@ -227,6 +234,59 @@ public void testMoveToTrashWithKerberosUser() throws IOException,
     assertEquals(1, fileStatuses.length);
   }
 
+  @Test
+  public void testMultipleMountPoint() throws IOException,
+      URISyntaxException, InterruptedException {
+    MountTable addEntry = MountTable.newInstance(MOUNT_POINT,
+        Collections.singletonMap(ns0, MOUNT_POINT));
+    MountTable addEntry1 = MountTable.newInstance(MOUNT_POINT1,
+        Collections.singletonMap(ns1, MOUNT_POINT1));
+    MountTable addEntry2 = MountTable.newInstance(MOUNT_POINT2,
+        Collections.singletonMap(ns1, MOUNT_POINT2));
+    assertTrue(addMountTable(addEntry));
+    assertTrue(addMountTable(addEntry1));
+    assertTrue(addMountTable(addEntry2));
+
+    DFSClient client = nnContext.getClient();
+    client.setOwner("/", TEST_USER, TEST_USER);
+
+    DFSClient client1 = nnContext1.getClient();
+    client1.setOwner("/", TEST_USER, TEST_USER);
+
+

Review Comment:
   OK. Thanks



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "LiuGuH (via GitHub)" <gi...@apache.org>.
LiuGuH commented on code in PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#discussion_r1406987425


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterTrash.java:
##########
@@ -227,6 +234,61 @@ public void testMoveToTrashWithKerberosUser() throws IOException,
     assertEquals(1, fileStatuses.length);
   }
 
+  @Test
+  public void testMultipleMountPoint() throws IOException,
+      URISyntaxException, InterruptedException {
+    MountTable addEntry = MountTable.newInstance(MOUNT_POINT,
+        Collections.singletonMap(ns0, MOUNT_POINT));
+    MountTable addEntry1 = MountTable.newInstance(MOUNT_POINT1,
+        Collections.singletonMap(ns1, MOUNT_POINT1));
+    MountTable addEntry2 = MountTable.newInstance(MOUNT_POINT2,
+        Collections.singletonMap(ns1, MOUNT_POINT2));
+    assertTrue(addMountTable(addEntry));
+    assertTrue(addMountTable(addEntry1));
+    assertTrue(addMountTable(addEntry2));
+
+    // current user client

Review Comment:
   Fixed. Thanks.



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterTrash.java:
##########
@@ -227,6 +234,61 @@ public void testMoveToTrashWithKerberosUser() throws IOException,
     assertEquals(1, fileStatuses.length);
   }
 
+  @Test
+  public void testMultipleMountPoint() throws IOException,
+      URISyntaxException, InterruptedException {
+    MountTable addEntry = MountTable.newInstance(MOUNT_POINT,
+        Collections.singletonMap(ns0, MOUNT_POINT));
+    MountTable addEntry1 = MountTable.newInstance(MOUNT_POINT1,
+        Collections.singletonMap(ns1, MOUNT_POINT1));
+    MountTable addEntry2 = MountTable.newInstance(MOUNT_POINT2,
+        Collections.singletonMap(ns1, MOUNT_POINT2));
+    assertTrue(addMountTable(addEntry));
+    assertTrue(addMountTable(addEntry1));
+    assertTrue(addMountTable(addEntry2));
+
+    // current user client
+    DFSClient client = nnContext.getClient();
+    client.setOwner("/", TEST_USER, TEST_USER);
+
+    DFSClient client1 = nnContext1.getClient();
+    client1.setOwner("/", TEST_USER, TEST_USER);
+
+
+    UserGroupInformation ugi = UserGroupInformation.
+        createRemoteUser(TEST_USER);
+    // test user client
+    client = nnContext.getClient(ugi);
+    client.mkdirs(MOUNT_POINT, new FsPermission("777"), true);
+    client.create(FILE, true);
+
+    client1 = nnContext1.getClient(ugi);
+    client1.mkdirs("/user", new FsPermission("777"), true);
+    client1.mkdirs(MOUNT_POINT1, new FsPermission("777"), true);
+    client1.create(FILE1, true);
+    client1.mkdirs(MOUNT_POINT2, new FsPermission("777"), true);
+
+    // move to Trash
+    Configuration routerConf = routerContext.getConf();
+    FileSystem fs =
+        DFSTestUtil.getFileSystemAs(ugi, routerConf);
+
+    Trash trash = new Trash(fs , routerConf);
+    assertTrue(trash.moveToTrash(new Path(FILE)));
+    assertTrue(trash.moveToTrash(new Path(FILE1)));
+
+
+    //Client user see gloabl trash view, wo should see all three mount point
+    FileStatus[] fileStatuses = fs.listStatus(new Path("/user/test-trash/.Trash/Current/"));
+    assertEquals(3, fileStatuses.length);
+
+    //This should return fileStatuses rather than Not found Exception
+    fileStatuses = fs.listStatus(new Path("/user/test-trash/.Trash/Current/"+MOUNT_POINT2));
+    assertEquals(0, fileStatuses.length);
+
+    client1.delete("/user",true);

Review Comment:
   Fixed. Thanks.



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. [RBF] Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "LiuGuH (via GitHub)" <gi...@apache.org>.
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.
   



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. [RBF] Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on code in PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#discussion_r1401902539


##########
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:
   Why do we need to remove  `/` ?



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 merged PR #6291:
URL: https://github.com/apache/hadoop/pull/6291


-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "Hexiaoqiao (via GitHub)" <gi...@apache.org>.
Hexiaoqiao commented on PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#issuecomment-1831921651

   Hi @slfan1989 , any more comments here? Thanks.


-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "hadoop-yetus (via GitHub)" <gi...@apache.org>.
hadoop-yetus commented on PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#issuecomment-1829026020

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 21s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  test4tests  |   0m  0s |  |  The patch appears to include 1 new or modified test files.  |
   |||| _ trunk Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  33m  7s |  |  trunk passed  |
   | +1 :green_heart: |  compile  |   0m 24s |  |  trunk passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  compile  |   0m 22s |  |  trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  checkstyle  |   0m 19s |  |  trunk passed  |
   | +1 :green_heart: |  mvnsite  |   0m 28s |  |  trunk passed  |
   | +1 :green_heart: |  javadoc  |   0m 28s |  |  trunk passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  javadoc  |   0m 17s |  |  trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  spotbugs  |   0m 51s |  |  trunk passed  |
   | +1 :green_heart: |  shadedclient  |  19m 26s |  |  branch has no errors when building and testing our client artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   0m 21s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 18s |  |  the patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  javac  |   0m 18s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 15s |  |  the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  javac  |   0m 15s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  checkstyle  |   0m 11s |  |  the patch passed  |
   | +1 :green_heart: |  mvnsite  |   0m 21s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 18s |  |  the patch passed with JDK Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04  |
   | +1 :green_heart: |  javadoc  |   0m 15s |  |  the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05  |
   | +1 :green_heart: |  spotbugs  |   0m 49s |  |  the patch passed  |
   | +1 :green_heart: |  shadedclient  |  19m 15s |  |  patch has no errors when building and testing our client artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |  19m  5s |  |  hadoop-hdfs-rbf in the patch passed.  |
   | +1 :green_heart: |  asflicense  |   0m 23s |  |  The patch does not generate ASF License warnings.  |
   |  |   |  99m 38s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6291/2/artifact/out/Dockerfile |
   | GITHUB PR | https://github.com/apache/hadoop/pull/6291 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets |
   | uname | Linux f6b900a36a15 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/bin/hadoop.sh |
   | git revision | trunk / b9f5f73028fe0ba86ffd12913003f79515615914 |
   | Default Java | Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
   | Multi-JDK versions | /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20.1+1-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05 |
   |  Test Results | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6291/2/testReport/ |
   | Max. process+thread count | 2593 (vs. ulimit of 5500) |
   | modules | C: hadoop-hdfs-project/hadoop-hdfs-rbf U: hadoop-hdfs-project/hadoop-hdfs-rbf |
   | Console output | https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6291/2/console |
   | versions | git=2.25.1 maven=3.6.3 spotbugs=4.2.2 |
   | Powered by | Apache Yetus 0.14.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. [RBF] Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "LiuGuH (via GitHub)" <gi...@apache.org>.
LiuGuH commented on PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#issuecomment-1822312358

   @zhuxiangyi @ferhui @goiri , Do you have time to review this? Thanks


-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#issuecomment-1833894765

   > Hi @slfan1989 , any more comments here? Thanks.
   
   @Hexiaoqiao LGTM +1, Thank you very much for your help in reviewing the code!


-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "Hexiaoqiao (via GitHub)" <gi...@apache.org>.
Hexiaoqiao commented on code in PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#discussion_r1407882437


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterTrash.java:
##########
@@ -227,6 +234,59 @@ public void testMoveToTrashWithKerberosUser() throws IOException,
     assertEquals(1, fileStatuses.length);
   }
 
+  @Test
+  public void testMultipleMountPoint() throws IOException,
+      URISyntaxException, InterruptedException {
+    MountTable addEntry = MountTable.newInstance(MOUNT_POINT,
+        Collections.singletonMap(ns0, MOUNT_POINT));
+    MountTable addEntry1 = MountTable.newInstance(MOUNT_POINT1,
+        Collections.singletonMap(ns1, MOUNT_POINT1));
+    MountTable addEntry2 = MountTable.newInstance(MOUNT_POINT2,
+        Collections.singletonMap(ns1, MOUNT_POINT2));
+    assertTrue(addMountTable(addEntry));
+    assertTrue(addMountTable(addEntry1));
+    assertTrue(addMountTable(addEntry2));
+
+    DFSClient client = nnContext.getClient();
+    client.setOwner("/", TEST_USER, TEST_USER);
+
+    DFSClient client1 = nnContext1.getClient();
+    client1.setOwner("/", TEST_USER, TEST_USER);
+
+

Review Comment:
   It is enough to leave only one blank line.



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterTrash.java:
##########
@@ -227,6 +234,59 @@ public void testMoveToTrashWithKerberosUser() throws IOException,
     assertEquals(1, fileStatuses.length);
   }
 
+  @Test
+  public void testMultipleMountPoint() throws IOException,
+      URISyntaxException, InterruptedException {
+    MountTable addEntry = MountTable.newInstance(MOUNT_POINT,
+        Collections.singletonMap(ns0, MOUNT_POINT));
+    MountTable addEntry1 = MountTable.newInstance(MOUNT_POINT1,
+        Collections.singletonMap(ns1, MOUNT_POINT1));
+    MountTable addEntry2 = MountTable.newInstance(MOUNT_POINT2,
+        Collections.singletonMap(ns1, MOUNT_POINT2));
+    assertTrue(addMountTable(addEntry));
+    assertTrue(addMountTable(addEntry1));
+    assertTrue(addMountTable(addEntry2));
+
+    DFSClient client = nnContext.getClient();
+    client.setOwner("/", TEST_USER, TEST_USER);
+
+    DFSClient client1 = nnContext1.getClient();
+    client1.setOwner("/", TEST_USER, TEST_USER);
+
+
+    UserGroupInformation ugi = UserGroupInformation.
+        createRemoteUser(TEST_USER);
+
+    client = nnContext.getClient(ugi);
+    client.mkdirs(MOUNT_POINT, new FsPermission("777"), true);
+    client.create(FILE, true);
+
+    client1 = nnContext1.getClient(ugi);
+    client1.mkdirs(MOUNT_POINT1, new FsPermission("777"), true);
+    client1.create(FILE1, true);
+    client1.mkdirs(MOUNT_POINT2, new FsPermission("777"), true);
+
+    //Move two different nameservice file to trash.

Review Comment:
   Please leave one blank space here. such as `// Move two different nameservice file to trash.`, and the same as other annotation.



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on code in PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#discussion_r1405853588


##########
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:
   Thanks for the explanation!



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "Hexiaoqiao (via GitHub)" <gi...@apache.org>.
Hexiaoqiao commented on code in PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#discussion_r1406206626


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterTrash.java:
##########
@@ -227,6 +234,61 @@ public void testMoveToTrashWithKerberosUser() throws IOException,
     assertEquals(1, fileStatuses.length);
   }
 
+  @Test
+  public void testMultipleMountPoint() throws IOException,
+      URISyntaxException, InterruptedException {
+    MountTable addEntry = MountTable.newInstance(MOUNT_POINT,
+        Collections.singletonMap(ns0, MOUNT_POINT));
+    MountTable addEntry1 = MountTable.newInstance(MOUNT_POINT1,
+        Collections.singletonMap(ns1, MOUNT_POINT1));
+    MountTable addEntry2 = MountTable.newInstance(MOUNT_POINT2,
+        Collections.singletonMap(ns1, MOUNT_POINT2));
+    assertTrue(addMountTable(addEntry));
+    assertTrue(addMountTable(addEntry1));
+    assertTrue(addMountTable(addEntry2));
+
+    // current user client
+    DFSClient client = nnContext.getClient();
+    client.setOwner("/", TEST_USER, TEST_USER);
+
+    DFSClient client1 = nnContext1.getClient();
+    client1.setOwner("/", TEST_USER, TEST_USER);
+
+
+    UserGroupInformation ugi = UserGroupInformation.
+        createRemoteUser(TEST_USER);
+    // test user client
+    client = nnContext.getClient(ugi);
+    client.mkdirs(MOUNT_POINT, new FsPermission("777"), true);
+    client.create(FILE, true);
+
+    client1 = nnContext1.getClient(ugi);
+    client1.mkdirs("/user", new FsPermission("777"), true);
+    client1.mkdirs(MOUNT_POINT1, new FsPermission("777"), true);
+    client1.create(FILE1, true);
+    client1.mkdirs(MOUNT_POINT2, new FsPermission("777"), true);
+
+    // move to Trash
+    Configuration routerConf = routerContext.getConf();
+    FileSystem fs =
+        DFSTestUtil.getFileSystemAs(ugi, routerConf);
+
+    Trash trash = new Trash(fs , routerConf);

Review Comment:
   Please fix the checkstyle.



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterTrash.java:
##########
@@ -227,6 +234,61 @@ public void testMoveToTrashWithKerberosUser() throws IOException,
     assertEquals(1, fileStatuses.length);
   }
 
+  @Test
+  public void testMultipleMountPoint() throws IOException,
+      URISyntaxException, InterruptedException {
+    MountTable addEntry = MountTable.newInstance(MOUNT_POINT,
+        Collections.singletonMap(ns0, MOUNT_POINT));
+    MountTable addEntry1 = MountTable.newInstance(MOUNT_POINT1,
+        Collections.singletonMap(ns1, MOUNT_POINT1));
+    MountTable addEntry2 = MountTable.newInstance(MOUNT_POINT2,
+        Collections.singletonMap(ns1, MOUNT_POINT2));
+    assertTrue(addMountTable(addEntry));
+    assertTrue(addMountTable(addEntry1));
+    assertTrue(addMountTable(addEntry2));
+
+    // current user client

Review Comment:
   Please format the annotations: Start with uppercase and end with period.



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterTrash.java:
##########
@@ -227,6 +234,61 @@ public void testMoveToTrashWithKerberosUser() throws IOException,
     assertEquals(1, fileStatuses.length);
   }
 
+  @Test
+  public void testMultipleMountPoint() throws IOException,
+      URISyntaxException, InterruptedException {
+    MountTable addEntry = MountTable.newInstance(MOUNT_POINT,
+        Collections.singletonMap(ns0, MOUNT_POINT));
+    MountTable addEntry1 = MountTable.newInstance(MOUNT_POINT1,
+        Collections.singletonMap(ns1, MOUNT_POINT1));
+    MountTable addEntry2 = MountTable.newInstance(MOUNT_POINT2,
+        Collections.singletonMap(ns1, MOUNT_POINT2));
+    assertTrue(addMountTable(addEntry));
+    assertTrue(addMountTable(addEntry1));
+    assertTrue(addMountTable(addEntry2));
+
+    // current user client
+    DFSClient client = nnContext.getClient();
+    client.setOwner("/", TEST_USER, TEST_USER);
+
+    DFSClient client1 = nnContext1.getClient();
+    client1.setOwner("/", TEST_USER, TEST_USER);
+
+
+    UserGroupInformation ugi = UserGroupInformation.
+        createRemoteUser(TEST_USER);
+    // test user client
+    client = nnContext.getClient(ugi);
+    client.mkdirs(MOUNT_POINT, new FsPermission("777"), true);
+    client.create(FILE, true);
+
+    client1 = nnContext1.getClient(ugi);
+    client1.mkdirs("/user", new FsPermission("777"), true);
+    client1.mkdirs(MOUNT_POINT1, new FsPermission("777"), true);
+    client1.create(FILE1, true);
+    client1.mkdirs(MOUNT_POINT2, new FsPermission("777"), true);
+
+    // move to Trash
+    Configuration routerConf = routerContext.getConf();
+    FileSystem fs =
+        DFSTestUtil.getFileSystemAs(ugi, routerConf);
+
+    Trash trash = new Trash(fs , routerConf);
+    assertTrue(trash.moveToTrash(new Path(FILE)));
+    assertTrue(trash.moveToTrash(new Path(FILE1)));
+
+
+    //Client user see gloabl trash view, wo should see all three mount point
+    FileStatus[] fileStatuses = fs.listStatus(new Path("/user/test-trash/.Trash/Current/"));
+    assertEquals(3, fileStatuses.length);
+
+    //This should return fileStatuses rather than Not found Exception
+    fileStatuses = fs.listStatus(new Path("/user/test-trash/.Trash/Current/"+MOUNT_POINT2));
+    assertEquals(0, fileStatuses.length);
+
+    client1.delete("/user",true);

Review Comment:
   Please fix the checkstyle.



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] HDFS-17263. RBF: Fix client ls trash path cannot get except default nameservices trash path [hadoop]

Posted by "LiuGuH (via GitHub)" <gi...@apache.org>.
LiuGuH commented on code in PR #6291:
URL: https://github.com/apache/hadoop/pull/6291#discussion_r1408780241


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterTrash.java:
##########
@@ -227,6 +234,59 @@ public void testMoveToTrashWithKerberosUser() throws IOException,
     assertEquals(1, fileStatuses.length);
   }
 
+  @Test
+  public void testMultipleMountPoint() throws IOException,
+      URISyntaxException, InterruptedException {
+    MountTable addEntry = MountTable.newInstance(MOUNT_POINT,
+        Collections.singletonMap(ns0, MOUNT_POINT));
+    MountTable addEntry1 = MountTable.newInstance(MOUNT_POINT1,
+        Collections.singletonMap(ns1, MOUNT_POINT1));
+    MountTable addEntry2 = MountTable.newInstance(MOUNT_POINT2,
+        Collections.singletonMap(ns1, MOUNT_POINT2));
+    assertTrue(addMountTable(addEntry));
+    assertTrue(addMountTable(addEntry1));
+    assertTrue(addMountTable(addEntry2));
+
+    DFSClient client = nnContext.getClient();
+    client.setOwner("/", TEST_USER, TEST_USER);
+
+    DFSClient client1 = nnContext1.getClient();
+    client1.setOwner("/", TEST_USER, TEST_USER);
+
+
+    UserGroupInformation ugi = UserGroupInformation.
+        createRemoteUser(TEST_USER);
+
+    client = nnContext.getClient(ugi);
+    client.mkdirs(MOUNT_POINT, new FsPermission("777"), true);
+    client.create(FILE, true);
+
+    client1 = nnContext1.getClient(ugi);
+    client1.mkdirs(MOUNT_POINT1, new FsPermission("777"), true);
+    client1.create(FILE1, true);
+    client1.mkdirs(MOUNT_POINT2, new FsPermission("777"), true);
+
+    //Move two different nameservice file to trash.

Review Comment:
   OK. Thanks



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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