Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-14211

FilterFs and ChRootedFs are too aggressive about enforcing "authorityNeeded"

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.9.0, 2.7.4, 3.0.0-alpha4, 2.8.2
    • Component/s: viewfs
    • Labels:
      None

      Description

      Right now FilterFs and ChRootedFs pass the following up to the AbstractFileSystem superconstructor:

          super(fs.getUri(), fs.getUri().getScheme(),
              fs.getUri().getAuthority() != null, fs.getUriDefaultPort());
      

      This passes a value of authorityNeeded==true for any fs which has an authority, but this isn't necessarily the case - ViewFS is an example of this. You will encounter this issue if you try to filter a ViewFS, or nest one ViewFS within another. The authorityNeeded check isn't necessary in this case anyway; fs is already an instantiated AbstractFileSystem which means it has already used the same constructor with the value of authorityNeeded (and corresponding validation) that it actually requires.

      1. HADOOP-14211.000.patch
        2 kB
        Erik Krogen
      2. HADOOP-14211.001.patch
        3 kB
        Erik Krogen

        Activity

        Hide
        xkrogen Erik Krogen added a comment -

        Attaching a patch which simply passes false for authorityNeeded. It includes a unit test which demonstrates this issue by nesting ViewFS though I'm not attached to that if it doesn't seem necessary...

        Pinging Sanjay Radia based on original authorship; Manoj Govindassamy / Andrew Wang based on recent involvement in other ViewFS-related work.

        Show
        xkrogen Erik Krogen added a comment - Attaching a patch which simply passes false for authorityNeeded . It includes a unit test which demonstrates this issue by nesting ViewFS though I'm not attached to that if it doesn't seem necessary... Pinging Sanjay Radia based on original authorship; Manoj Govindassamy / Andrew Wang based on recent involvement in other ViewFS-related work.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 27s 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 14m 10s trunk passed
        +1 compile 20m 47s trunk passed
        +1 checkstyle 0m 37s trunk passed
        +1 mvnsite 1m 1s trunk passed
        +1 mvneclipse 0m 19s trunk passed
        +1 findbugs 1m 25s trunk passed
        +1 javadoc 0m 49s trunk passed
        +1 mvninstall 0m 36s the patch passed
        +1 compile 15m 50s the patch passed
        +1 javac 15m 50s the patch passed
        +1 checkstyle 0m 36s the patch passed
        +1 mvnsite 1m 1s the patch passed
        +1 mvneclipse 0m 19s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 32s the patch passed
        +1 javadoc 0m 48s the patch passed
        -1 unit 8m 0s hadoop-common in the patch failed.
        +1 asflicense 0m 33s The patch does not generate ASF License warnings.
        70m 47s



        Reason Tests
        Failed junit tests hadoop.security.TestKDiag



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue HADOOP-14211
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12859824/HADOOP-14211.000.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 452e5a3cf6b5 3.13.0-106-generic #153-Ubuntu SMP Tue Dec 6 15:44:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / f462e1f
        Default Java 1.8.0_121
        findbugs v3.0.0
        unit https://builds.apache.org/job/PreCommit-HADOOP-Build/11867/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/11867/testReport/
        modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/11867/console
        Powered by Apache Yetus 0.5.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 27s 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 14m 10s trunk passed +1 compile 20m 47s trunk passed +1 checkstyle 0m 37s trunk passed +1 mvnsite 1m 1s trunk passed +1 mvneclipse 0m 19s trunk passed +1 findbugs 1m 25s trunk passed +1 javadoc 0m 49s trunk passed +1 mvninstall 0m 36s the patch passed +1 compile 15m 50s the patch passed +1 javac 15m 50s the patch passed +1 checkstyle 0m 36s the patch passed +1 mvnsite 1m 1s the patch passed +1 mvneclipse 0m 19s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 32s the patch passed +1 javadoc 0m 48s the patch passed -1 unit 8m 0s hadoop-common in the patch failed. +1 asflicense 0m 33s The patch does not generate ASF License warnings. 70m 47s Reason Tests Failed junit tests hadoop.security.TestKDiag Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue HADOOP-14211 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12859824/HADOOP-14211.000.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 452e5a3cf6b5 3.13.0-106-generic #153-Ubuntu SMP Tue Dec 6 15:44:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / f462e1f Default Java 1.8.0_121 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HADOOP-Build/11867/artifact/patchprocess/patch-unit-hadoop-common-project_hadoop-common.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/11867/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/11867/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        andrew.wang Andrew Wang added a comment -

        Interesting find here Erik! I notice that both ChRootedFs and FilterFs have this special, and probably both should be updated. Filtering a ViewFs is also perhaps a more likely real-world usecase.

        Show
        andrew.wang Andrew Wang added a comment - Interesting find here Erik! I notice that both ChRootedFs and FilterFs have this special, and probably both should be updated. Filtering a ViewFs is also perhaps a more likely real-world usecase.
        Hide
        xkrogen Erik Krogen added a comment -

        Thanks for pointing that out Andrew Wang! I updated the ticket and added a new v001 patch to reflect changes to both FilterFs and ChRootedFs. This makes for a bit more sensical unit test as well.

        Show
        xkrogen Erik Krogen added a comment - Thanks for pointing that out Andrew Wang ! I updated the ticket and added a new v001 patch to reflect changes to both FilterFs and ChRootedFs . This makes for a bit more sensical unit test as well.
        Hide
        hadoopqa Hadoop QA added a comment -
        +1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 21s 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 13m 15s trunk passed
        +1 compile 15m 13s trunk passed
        +1 checkstyle 0m 34s trunk passed
        +1 mvnsite 1m 4s trunk passed
        +1 mvneclipse 0m 18s trunk passed
        +1 findbugs 1m 31s trunk passed
        +1 javadoc 0m 48s trunk passed
        +1 mvninstall 0m 39s the patch passed
        +1 compile 13m 9s the patch passed
        +1 javac 13m 9s the patch passed
        +1 checkstyle 0m 35s the patch passed
        +1 mvnsite 1m 0s the patch passed
        +1 mvneclipse 0m 19s the patch passed
        +1 whitespace 0m 1s The patch has no whitespace issues.
        +1 findbugs 1m 33s the patch passed
        +1 javadoc 0m 47s the patch passed
        +1 unit 7m 31s hadoop-common in the patch passed.
        +1 asflicense 0m 34s The patch does not generate ASF License warnings.
        61m 23s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:a9ad5d6
        JIRA Issue HADOOP-14211
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12860399/HADOOP-14211.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 955e8fdcaee2 3.13.0-106-generic #153-Ubuntu SMP Tue Dec 6 15:44:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / d4f73e7
        Default Java 1.8.0_121
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/11924/testReport/
        modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/11924/console
        Powered by Apache Yetus 0.5.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 21s 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 13m 15s trunk passed +1 compile 15m 13s trunk passed +1 checkstyle 0m 34s trunk passed +1 mvnsite 1m 4s trunk passed +1 mvneclipse 0m 18s trunk passed +1 findbugs 1m 31s trunk passed +1 javadoc 0m 48s trunk passed +1 mvninstall 0m 39s the patch passed +1 compile 13m 9s the patch passed +1 javac 13m 9s the patch passed +1 checkstyle 0m 35s the patch passed +1 mvnsite 1m 0s the patch passed +1 mvneclipse 0m 19s the patch passed +1 whitespace 0m 1s The patch has no whitespace issues. +1 findbugs 1m 33s the patch passed +1 javadoc 0m 47s the patch passed +1 unit 7m 31s hadoop-common in the patch passed. +1 asflicense 0m 34s The patch does not generate ASF License warnings. 61m 23s Subsystem Report/Notes Docker Image:yetus/hadoop:a9ad5d6 JIRA Issue HADOOP-14211 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12860399/HADOOP-14211.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 955e8fdcaee2 3.13.0-106-generic #153-Ubuntu SMP Tue Dec 6 15:44:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / d4f73e7 Default Java 1.8.0_121 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/11924/testReport/ modules C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/11924/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        andrew.wang Andrew Wang added a comment -

        Thanks Erik, committed to trunk and branch-2.

        Have you checked if FilterFileSystem and ViewFileSystem suffer from a similar problem? Most apps are more comfortable with the FileSystem APIs. I don't know anything that uses FileContext besides YARN and MR2.

        Show
        andrew.wang Andrew Wang added a comment - Thanks Erik, committed to trunk and branch-2. Have you checked if FilterFileSystem and ViewFileSystem suffer from a similar problem? Most apps are more comfortable with the FileSystem APIs. I don't know anything that uses FileContext besides YARN and MR2.
        Hide
        xkrogen Erik Krogen added a comment -

        Andrew Wang thanks for the review/commit! Yeah, I checked, and they don't. The validation logic generally became a little stricter in the FileContext APIs. Agreed that nothing else really uses them which is, I assume, why I'm uncovering issues that only exist in the "new" APIs and have been fixed in FileSystem...

        Show
        xkrogen Erik Krogen added a comment - Andrew Wang thanks for the review/commit! Yeah, I checked, and they don't. The validation logic generally became a little stricter in the FileContext APIs. Agreed that nothing else really uses them which is, I assume, why I'm uncovering issues that only exist in the "new" APIs and have been fixed in FileSystem ...
        Hide
        andrew.wang Andrew Wang added a comment -

        Cool, thanks for doing the legwork

        Show
        andrew.wang Andrew Wang added a comment - Cool, thanks for doing the legwork
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11454 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11454/)
        HADOOP-14211. FilterFs and ChRootedFs are too aggressive about enforcing (wang: rev 0e556a5ba645570d381beca60114a1239b27d49f)

        • (edit) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFilterFs.java
        • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFs.java
        • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFs.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11454 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11454/ ) HADOOP-14211 . FilterFs and ChRootedFs are too aggressive about enforcing (wang: rev 0e556a5ba645570d381beca60114a1239b27d49f) (edit) hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFilterFs.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFs.java (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFs.java
        Hide
        zhz Zhe Zhang added a comment -

        Thanks Erik Krogen for the work and Andrew Wang for the review. +1 on the patch as well. I just cherry-picked to branch-2.8 and branch-2.7.

        Show
        zhz Zhe Zhang added a comment - Thanks Erik Krogen for the work and Andrew Wang for the review. +1 on the patch as well. I just cherry-picked to branch-2.8 and branch-2.7.
        Hide
        vinodkv Vinod Kumar Vavilapalli added a comment -

        2.8.1 became a security release. Moving fix-version to 2.8.2 after the fact.

        Show
        vinodkv Vinod Kumar Vavilapalli added a comment - 2.8.1 became a security release. Moving fix-version to 2.8.2 after the fact.

          People

          • Assignee:
            xkrogen Erik Krogen
            Reporter:
            xkrogen Erik Krogen
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development