Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10832

Propagate ACL bit and isEncrypted bit in HttpFS FileStatus permissions

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.6.4
    • Fix Version/s: 2.8.0, 3.0.0-alpha2
    • Component/s: httpfs
    • Labels:
      None
    • Target Version/s:

      Description

      HDFS-6326 introduced an ephemeral ACL bit in FSPermission to avoid doing extra getAclStatus calls during listStatus.

      Parsing this extra bit was not carried over to HttpFS. Currently, it tries to detect ACLs being disabled by catching exceptions (somewhat brittle). When ACLs are on, it will do a getAclStatus per FileStatus object. This could have severe performance implications.

      Snippet from FSOperations:

            /*
             * For each FileStatus, attempt to acquire an AclStatus.  If the
             * getAclStatus throws an exception, we assume that ACLs are turned
             * off entirely and abandon the attempt.
             */
            boolean useAcls = true;   // Assume ACLs work until proven otherwise
            for (int i = 0; i < fileStatuses.length; i++) {
              if (useAcls) {
                try {
                  aclStatus = fs.getAclStatus(fileStatuses[i].getPath());
                } catch (AclException e) {
                  /* Almost certainly due to an "ACLs not enabled" exception */
                  aclStatus = null;
                  useAcls = false;
                } catch (UnsupportedOperationException e) {
                  /* Ditto above - this is the case for a local file system */
                  aclStatus = null;
                  useAcls = false;
                }
              }
              statusPairs[i] = new StatusPair(fileStatuses[i], aclStatus);
      
      1. HDFS-10823.001.patch
        25 kB
        Andrew Wang
      2. HDFS-10832.002.patch
        34 kB
        Andrew Wang
      3. HDFS-10832.003.patch
        36 kB
        Andrew Wang

        Issue Links

          Activity

          Hide
          xiaochen Xiao Chen added a comment -

          oops, thanks for correcting the fix versions for me Andrew!

          Show
          xiaochen Xiao Chen added a comment - oops, thanks for correcting the fix versions for me Andrew!
          Hide
          xiaochen Xiao Chen added a comment -

          FYI - I have backported this to branch-2.8 for cleaner backport of HDFS-10489. Thanks!

          Show
          xiaochen Xiao Chen added a comment - FYI - I have backported this to branch-2.8 for cleaner backport of HDFS-10489 . Thanks!
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10421 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10421/)
          HDFS-10832. Propagate ACL bit and isEncrypted bit in HttpFS FileStatus (wang: rev cba973f036a2c8fcc21a5826b8306247ec154c7b)

          • (edit) hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java
          • (edit) hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java
          • (edit) hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java
          • (edit) hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10421 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10421/ ) HDFS-10832 . Propagate ACL bit and isEncrypted bit in HttpFS FileStatus (wang: rev cba973f036a2c8fcc21a5826b8306247ec154c7b) (edit) hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java (edit) hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/test/TestHdfsHelper.java (edit) hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java (edit) hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/fs/http/client/BaseTestHttpFSWith.java
          Hide
          andrew.wang Andrew Wang added a comment -

          Pushed to trunk and branch-2, fixed one additional checkstyle at commit time but the others aren't fixable without reformatting existing code.

          Thanks to Xiao for reviews!

          Show
          andrew.wang Andrew Wang added a comment - Pushed to trunk and branch-2, fixed one additional checkstyle at commit time but the others aren't fixable without reformatting existing code. Thanks to Xiao for reviews!
          Hide
          hadoopqa Hadoop QA added a comment -
          +1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 18s Docker mode activated.
          +1 @author 0m 0s The patch does not contain any @author tags.
          +1 test4tests 0m 0s The patch appears to include 2 new or modified test files.
          +1 mvninstall 6m 55s trunk passed
          +1 compile 0m 17s trunk passed
          +1 checkstyle 0m 15s trunk passed
          +1 mvnsite 0m 25s trunk passed
          +1 mvneclipse 0m 11s trunk passed
          +1 findbugs 0m 25s trunk passed
          +1 javadoc 0m 13s trunk passed
          +1 mvninstall 0m 27s the patch passed
          +1 compile 0m 13s the patch passed
          +1 javac 0m 13s the patch passed
          -0 checkstyle 0m 13s hadoop-hdfs-project/hadoop-hdfs-httpfs: The patch generated 4 new + 212 unchanged - 30 fixed = 216 total (was 242)
          +1 mvnsite 0m 21s the patch passed
          +1 mvneclipse 0m 9s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 0m 29s the patch passed
          +1 javadoc 0m 11s the patch passed
          +1 unit 3m 25s hadoop-hdfs-httpfs in the patch passed.
          +1 asflicense 0m 15s The patch does not generate ASF License warnings.
          15m 56s



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:9560f25
          JIRA Issue HDFS-10832
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827806/HDFS-10832.003.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux e3306df93fad 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 9f192cc
          Default Java 1.8.0_101
          findbugs v3.0.0
          checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16687/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-httpfs.txt
          Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16687/testReport/
          modules C: hadoop-hdfs-project/hadoop-hdfs-httpfs U: hadoop-hdfs-project/hadoop-hdfs-httpfs
          Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16687/console
          Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 reexec 0m 18s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 2 new or modified test files. +1 mvninstall 6m 55s trunk passed +1 compile 0m 17s trunk passed +1 checkstyle 0m 15s trunk passed +1 mvnsite 0m 25s trunk passed +1 mvneclipse 0m 11s trunk passed +1 findbugs 0m 25s trunk passed +1 javadoc 0m 13s trunk passed +1 mvninstall 0m 27s the patch passed +1 compile 0m 13s the patch passed +1 javac 0m 13s the patch passed -0 checkstyle 0m 13s hadoop-hdfs-project/hadoop-hdfs-httpfs: The patch generated 4 new + 212 unchanged - 30 fixed = 216 total (was 242) +1 mvnsite 0m 21s the patch passed +1 mvneclipse 0m 9s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 0m 29s the patch passed +1 javadoc 0m 11s the patch passed +1 unit 3m 25s hadoop-hdfs-httpfs in the patch passed. +1 asflicense 0m 15s The patch does not generate ASF License warnings. 15m 56s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HDFS-10832 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827806/HDFS-10832.003.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux e3306df93fad 3.13.0-92-generic #139-Ubuntu SMP Tue Jun 28 20:42:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 9f192cc Default Java 1.8.0_101 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16687/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-httpfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16687/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs-httpfs U: hadoop-hdfs-project/hadoop-hdfs-httpfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16687/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          andrew.wang Andrew Wang added a comment -

          One more rev to address checkstyle, thanks again for the review.

          Show
          andrew.wang Andrew Wang added a comment - One more rev to address checkstyle, thanks again for the review.
          Hide
          xiaochen Xiao Chen added a comment -

          Thanks Andrew! The new patch looks great, and I had a fun time getting to know Parameterized tests.
          +1 pending the checkstyles.

          Show
          xiaochen Xiao Chen added a comment - Thanks Andrew! The new patch looks great, and I had a fun time getting to know Parameterized tests. +1 pending the checkstyles.
          Hide
          hadoopqa Hadoop QA added a comment -
          +1 overall



          Vote Subsystem Runtime Comment
          0 reexec 12m 35s Docker mode activated.
          +1 @author 0m 0s The patch does not contain any @author tags.
          +1 test4tests 0m 0s The patch appears to include 2 new or modified test files.
          +1 mvninstall 7m 37s trunk passed
          +1 compile 0m 16s trunk passed
          +1 checkstyle 0m 16s trunk passed
          +1 mvnsite 0m 25s trunk passed
          +1 mvneclipse 0m 12s trunk passed
          +1 findbugs 0m 23s trunk passed
          +1 javadoc 0m 14s trunk passed
          +1 mvninstall 0m 27s the patch passed
          +1 compile 0m 14s the patch passed
          +1 javac 0m 14s the patch passed
          -0 checkstyle 0m 12s hadoop-hdfs-project/hadoop-hdfs-httpfs: The patch generated 21 new + 213 unchanged - 29 fixed = 234 total (was 242)
          +1 mvnsite 0m 22s the patch passed
          +1 mvneclipse 0m 9s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 0m 28s the patch passed
          +1 javadoc 0m 11s the patch passed
          +1 unit 3m 31s hadoop-hdfs-httpfs in the patch passed.
          +1 asflicense 0m 16s The patch does not generate ASF License warnings.
          29m 6s



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:9560f25
          JIRA Issue HDFS-10832
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827495/HDFS-10832.002.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux f534857b788a 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / d355573
          Default Java 1.8.0_101
          findbugs v3.0.0
          checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16670/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-httpfs.txt
          Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16670/testReport/
          modules C: hadoop-hdfs-project/hadoop-hdfs-httpfs U: hadoop-hdfs-project/hadoop-hdfs-httpfs
          Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16670/console
          Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 reexec 12m 35s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 2 new or modified test files. +1 mvninstall 7m 37s trunk passed +1 compile 0m 16s trunk passed +1 checkstyle 0m 16s trunk passed +1 mvnsite 0m 25s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 0m 23s trunk passed +1 javadoc 0m 14s trunk passed +1 mvninstall 0m 27s the patch passed +1 compile 0m 14s the patch passed +1 javac 0m 14s the patch passed -0 checkstyle 0m 12s hadoop-hdfs-project/hadoop-hdfs-httpfs: The patch generated 21 new + 213 unchanged - 29 fixed = 234 total (was 242) +1 mvnsite 0m 22s the patch passed +1 mvneclipse 0m 9s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 0m 28s the patch passed +1 javadoc 0m 11s the patch passed +1 unit 3m 31s hadoop-hdfs-httpfs in the patch passed. +1 asflicense 0m 16s The patch does not generate ASF License warnings. 29m 6s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HDFS-10832 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12827495/HDFS-10832.002.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux f534857b788a 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / d355573 Default Java 1.8.0_101 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16670/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-httpfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16670/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs-httpfs U: hadoop-hdfs-project/hadoop-hdfs-httpfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16670/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          andrew.wang Andrew Wang added a comment -

          Thanks for reviewing Xiao, patch attached should address your feedback.

          Show
          andrew.wang Andrew Wang added a comment - Thanks for reviewing Xiao, patch attached should address your feedback.
          Hide
          xiaochen Xiao Chen added a comment -

          Good find Andrew! Patch looks great too.

          Some comments:

          • HttpFSFileSystem: I think we can just pass in the json object to toFsPermission to make it more encapsulated.
          • FSOperations: We can drop the explicit type arguments in map initialization.
          • Test: maybe we can add a test case to cover encbit too?
          Show
          xiaochen Xiao Chen added a comment - Good find Andrew! Patch looks great too. Some comments: HttpFSFileSystem: I think we can just pass in the json object to toFsPermission to make it more encapsulated. FSOperations: We can drop the explicit type arguments in map initialization. Test: maybe we can add a test case to cover encbit too?
          Hide
          hadoopqa Hadoop QA added a comment -
          +1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 19s Docker mode activated.
          +1 @author 0m 0s The patch does not contain any @author tags.
          +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
          +1 mvninstall 7m 20s trunk passed
          +1 compile 0m 17s trunk passed
          +1 checkstyle 0m 15s trunk passed
          +1 mvnsite 0m 25s trunk passed
          +1 mvneclipse 0m 13s trunk passed
          +1 findbugs 0m 25s trunk passed
          +1 javadoc 0m 14s trunk passed
          +1 mvninstall 0m 34s the patch passed
          +1 compile 0m 19s the patch passed
          +1 javac 0m 19s the patch passed
          -0 checkstyle 0m 15s hadoop-hdfs-project/hadoop-hdfs-httpfs: The patch generated 19 new + 199 unchanged - 29 fixed = 218 total (was 228)
          +1 mvnsite 0m 29s the patch passed
          +1 mvneclipse 0m 11s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 0m 41s the patch passed
          +1 javadoc 0m 13s the patch passed
          +1 unit 3m 45s hadoop-hdfs-httpfs in the patch passed.
          +1 asflicense 0m 15s The patch does not generate ASF License warnings.
          17m 40s



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:9560f25
          JIRA Issue HDFS-10832
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12826750/HDFS-10823.001.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux 7a40c9dfb04a 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
          Build tool maven
          Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
          git revision trunk / 0690f09
          Default Java 1.8.0_101
          findbugs v3.0.0
          checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16613/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-httpfs.txt
          Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16613/testReport/
          modules C: hadoop-hdfs-project/hadoop-hdfs-httpfs U: hadoop-hdfs-project/hadoop-hdfs-httpfs
          Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16613/console
          Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 reexec 0m 19s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 20s trunk passed +1 compile 0m 17s trunk passed +1 checkstyle 0m 15s trunk passed +1 mvnsite 0m 25s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 0m 25s trunk passed +1 javadoc 0m 14s trunk passed +1 mvninstall 0m 34s the patch passed +1 compile 0m 19s the patch passed +1 javac 0m 19s the patch passed -0 checkstyle 0m 15s hadoop-hdfs-project/hadoop-hdfs-httpfs: The patch generated 19 new + 199 unchanged - 29 fixed = 218 total (was 228) +1 mvnsite 0m 29s the patch passed +1 mvneclipse 0m 11s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 0m 41s the patch passed +1 javadoc 0m 13s the patch passed +1 unit 3m 45s hadoop-hdfs-httpfs in the patch passed. +1 asflicense 0m 15s The patch does not generate ASF License warnings. 17m 40s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HDFS-10832 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12826750/HDFS-10823.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 7a40c9dfb04a 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 0690f09 Default Java 1.8.0_101 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16613/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-httpfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16613/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs-httpfs U: hadoop-hdfs-project/hadoop-hdfs-httpfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16613/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          andrew.wang Andrew Wang added a comment -

          Patch attached. This is actually a bit worse than I thought. The acl bit wasn't being read by HttpFSFileSystem, which was missed since the unit tests only do getAclStatus.

          We also missed adding support for the encBit to HttpFS on both the server and client, so I forward that along as well.

          Show
          andrew.wang Andrew Wang added a comment - Patch attached. This is actually a bit worse than I thought. The acl bit wasn't being read by HttpFSFileSystem, which was missed since the unit tests only do getAclStatus. We also missed adding support for the encBit to HttpFS on both the server and client, so I forward that along as well.

            People

            • Assignee:
              andrew.wang Andrew Wang
              Reporter:
              andrew.wang Andrew Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development