Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-6313

WebHdfs may use the wrong NN when configured for multiple HA NNs

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 2.4.0
    • Fix Version/s: 2.4.1
    • Component/s: webhdfs
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      WebHdfs resolveNNAddr will return a union of addresses for all HA configured NNs. The client may access the wrong NN.

      1. HDFS-6313.patch
        5 kB
        Kihwal Lee
      2. HDFS-6313.branch-2.4.patch
        5 kB
        Kihwal Lee

        Activity

        Daryn Sharp created issue -
        Kihwal Lee made changes -
        Field Original Value New Value
        Target Version/s 2.5.0 [ 12326264 ] 2.4.1 [ 12326696 ]
        Priority Major [ 3 ] Blocker [ 1 ]
        Hide
        Kihwal Lee added a comment -

        In 2.4.0 it is DFSUtil.resolveWebHdfsUri(). In trunk, it is WebHdfsFileSystem#resolveNNAddr()}. They all obtain NN addresses by calling {{DFSUtil.getAddresses(), which gets all NN http addresses from all known name services. If multiple name services are configured, WebHdfsFileSystem can use a wrong NN.

        Show
        Kihwal Lee added a comment - In 2.4.0 it is DFSUtil.resolveWebHdfsUri() . In trunk, it is WebHdfsFileSystem#resolveNNAddr()}. They all obtain NN addresses by calling {{DFSUtil.getAddresses() , which gets all NN http addresses from all known name services. If multiple name services are configured, WebHdfsFileSystem can use a wrong NN.
        Hide
        Kihwal Lee added a comment -

        The patch makes WebHdfsFileSystem extract the only entry that matches the logical name. The new test case demonstrates the bug.

        Show
        Kihwal Lee added a comment - The patch makes WebHdfsFileSystem extract the only entry that matches the logical name. The new test case demonstrates the bug.
        Kihwal Lee made changes -
        Attachment HDFS-6313.branch-2.4.patch [ 12643423 ]
        Attachment HDFS-6313.patch [ 12643424 ]
        Kihwal Lee made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Kihwal Lee made changes -
        Assignee Kihwal Lee [ kihwal ]
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12643424/HDFS-6313.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 2 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. There were no new javadoc warning messages.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/6830//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/6830//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12643424/HDFS-6313.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 2 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/6830//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/6830//console This message is automatically generated.
        Hide
        Daryn Sharp added a comment -

        Looks good. Should the test clone the conf for the client before injecting another logical name to ensure it doesn't cause side-effects in the minicluster?

        Show
        Daryn Sharp added a comment - Looks good. Should the test clone the conf for the client before injecting another logical name to ensure it doesn't cause side-effects in the minicluster?
        Hide
        Kihwal Lee added a comment -

        MiniDFSCluster or NN does not alter the config after its up. It was a easy way to get HA config set up for the test.

        Show
        Kihwal Lee added a comment - MiniDFSCluster or NN does not alter the config after its up. It was a easy way to get HA config set up for the test.
        Hide
        Daryn Sharp added a comment -

        +1 I see. It's just client usage of the config so it's ok.

        Show
        Daryn Sharp added a comment - +1 I see. It's just client usage of the config so it's ok.
        Hide
        Kihwal Lee added a comment -

        Committed to branch-2, branch-2.4 and trunk. Thanks for reporting the bug and reviewing the patch, Daryn.

        Show
        Kihwal Lee added a comment - Committed to branch-2, branch-2.4 and trunk. Thanks for reporting the bug and reviewing the patch, Daryn.
        Kihwal Lee made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Fix Version/s 3.0.0 [ 12320356 ]
        Fix Version/s 2.4.1 [ 12326696 ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #5600 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5600/)
        HDFS-6313. WebHdfs may use the wrong NN when configured for multiple HA NNs. Contributed by Kihwal Lee. (kihwal: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1593475)

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFSForHA.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #5600 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5600/ ) HDFS-6313 . WebHdfs may use the wrong NN when configured for multiple HA NNs. Contributed by Kihwal Lee. (kihwal: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1593475 ) /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFSForHA.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Yarn-trunk #560 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/560/)
        HDFS-6313. WebHdfs may use the wrong NN when configured for multiple HA NNs. Contributed by Kihwal Lee. (kihwal: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1593475)

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFSForHA.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #560 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/560/ ) HDFS-6313 . WebHdfs may use the wrong NN when configured for multiple HA NNs. Contributed by Kihwal Lee. (kihwal: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1593475 ) /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFSForHA.java
        Hide
        Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk #1778 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1778/)
        HDFS-6313. WebHdfs may use the wrong NN when configured for multiple HA NNs. Contributed by Kihwal Lee. (kihwal: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1593475)

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFSForHA.java
        Show
        Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #1778 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1778/ ) HDFS-6313 . WebHdfs may use the wrong NN when configured for multiple HA NNs. Contributed by Kihwal Lee. (kihwal: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1593475 ) /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFSForHA.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Hdfs-trunk #1752 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1752/)
        HDFS-6313. WebHdfs may use the wrong NN when configured for multiple HA NNs. Contributed by Kihwal Lee. (kihwal: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1593475)

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFSForHA.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #1752 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1752/ ) HDFS-6313 . WebHdfs may use the wrong NN when configured for multiple HA NNs. Contributed by Kihwal Lee. (kihwal: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1593475 ) /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFSForHA.java
        Arun C Murthy made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Allen Wittenauer made changes -
        Fix Version/s 3.0.0 [ 12320356 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        5d 4h 33m 1 Kihwal Lee 05/May/14 21:54
        Patch Available Patch Available Resolved Resolved
        3d 5h 15m 1 Kihwal Lee 09/May/14 03:09
        Resolved Resolved Closed Closed
        52d 6h 8m 1 Arun C Murthy 30/Jun/14 09:18

          People

          • Assignee:
            Kihwal Lee
            Reporter:
            Daryn Sharp
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development