adoroszlai commented on a change in pull request #1398:
URL: https://github.com/apache/hadoop-ozone/pull/1398#discussion_r483929995



##########
File path: 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithData.java
##########
@@ -69,6 +70,38 @@ public void testAllOMNodesRunning() throws Exception {
     createKeyTest(true);
   }
 
+  @Test
+  public void testBucketLinkOps() throws Exception {

Review comment:
       We already have acceptance test for links, but currently it is only run 
in non-HA setup.  Instead of adding integration test, I think we should run the 
existing test in HA setup, too:
   
   ```
   execute_robot_test scm basic/links.robot
   ```
   
   could be added to 
`hadoop-ozone/dist/src/main/compose/ozonesecure-om-ha/test.sh` and maybe 
`hadoop-ozone/dist/src/main/compose/ozone-om-ha-s3/test.sh`.
   
   This confirms that the bug and the fix.
   
   However, I also see two of the test cases failing with the fix:
   
   ```
   Cannot follow link without read access                                | FAIL 
|
   ACL verified on source bucket                                         | FAIL 
|
   ```

##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -3523,6 +3533,47 @@ public ResolvedBucket resolveBucketLink(Pair<String, 
String> requested)
         visited);
   }
 
+  /**
+   * Resolves bucket symlinks. Read permission is required for following links.
+   *
+   * @param volumeAndBucket the bucket to be resolved (if it is a link)
+   * @param {@link OMClientRequest}  which has information required to check
+   * permission.
+   * @param visited collects link buckets visited during the resolution to
+   *   avoid infinite loops
+   * @return bucket location possibly updated with its actual volume and bucket
+   *   after following bucket links
+   * @throws IOException (most likely OMException) if ACL check fails, bucket 
is
+   *   not found, loop is detected in the links, etc.
+   */
+  private Pair<String, String> resolveBucketLink(
+      Pair<String, String> volumeAndBucket,
+      Set<Pair<String, String>> visited,
+      OMClientRequest omClientRequest) throws IOException {

Review comment:
       Would it be possible to replace the original `resolveBucketLink` method 
with this one, instead of duplicating it?




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to