Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-6236

ImageServlet should use Time#monotonicNow to measure latency.

    Details

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

      Description

      ImageServlet currently uses Time#now to get file transfer latency measurements and pass them to the metrics system. It would be preferrable to use Time#monotonicNow so that we're using the most precise available system timer, and we're not subject to odd bugs that could result in negative latency measurements, like resetting the system clock.

      1. HDFS-6236.1.patch
        4 kB
        Chris Nauroth

        Activity

        Hide
        Chris Nauroth added a comment -

        I noticed this due to a failure in TestCheckpoint#testCheckpoint on Windows. There are assertions that the metrics are greater than zero, and these assertions were failing. Windows in particular has a low-precision implementation of System#currentTimeMillis. This patch fixes the issue. Tests are passing consistently for me on both Mac and Windows now.

        I also discovered a problem inside TestCheckpoint#testReformatNNBetweenCheckpoints. Restarting a new MiniDFSCluster ended up trying to use the same storage directory as a SecondaryNameNode that was intentionally left running in the background. The new cluster would fail during initialization due to file locks while trying to delete the storage directory. To solve this, I've cloned the configuration and set a different storage dir for use by the 2NN.

        Show
        Chris Nauroth added a comment - I noticed this due to a failure in TestCheckpoint#testCheckpoint on Windows. There are assertions that the metrics are greater than zero, and these assertions were failing. Windows in particular has a low-precision implementation of System#currentTimeMillis . This patch fixes the issue. Tests are passing consistently for me on both Mac and Windows now. I also discovered a problem inside TestCheckpoint#testReformatNNBetweenCheckpoints . Restarting a new MiniDFSCluster ended up trying to use the same storage directory as a SecondaryNameNode that was intentionally left running in the background. The new cluster would fail during initialization due to file locks while trying to delete the storage directory. To solve this, I've cloned the configuration and set a different storage dir for use by the 2NN.
        Hide
        Haohui Mai added a comment -

        +1 pending jenkins.

        Show
        Haohui Mai added a comment - +1 pending jenkins.
        Hide
        Hadoop QA added a comment -

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

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

        +1 tests included. The patch appears to include 1 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/6655//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/6655//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/12639894/HDFS-6236.1.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 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/6655//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/6655//console This message is automatically generated.
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-trunk-Commit #5509 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5509/)
        HDFS-6236. ImageServlet should use Time#monotonicNow to measure latency. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1586902)

        • /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/server/namenode/ImageServlet.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #5509 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5509/ ) HDFS-6236 . ImageServlet should use Time#monotonicNow to measure latency. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1586902 ) /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/server/namenode/ImageServlet.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
        Hide
        Chris Nauroth added a comment -

        Thanks very much for the review, Haohui. I have committed this to trunk, branch-2 and branch-2.4.

        Show
        Chris Nauroth added a comment - Thanks very much for the review, Haohui. I have committed this to trunk, branch-2 and branch-2.4.
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Yarn-trunk #539 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/539/)
        HDFS-6236. ImageServlet should use Time#monotonicNow to measure latency. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1586902)

        • /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/server/namenode/ImageServlet.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #539 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/539/ ) HDFS-6236 . ImageServlet should use Time#monotonicNow to measure latency. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1586902 ) /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/server/namenode/ImageServlet.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
        Hide
        Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #1731 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1731/)
        HDFS-6236. ImageServlet should use Time#monotonicNow to measure latency. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1586902)

        • /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/server/namenode/ImageServlet.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
        Show
        Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #1731 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1731/ ) HDFS-6236 . ImageServlet should use Time#monotonicNow to measure latency. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1586902 ) /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/server/namenode/ImageServlet.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
        Hide
        Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Mapreduce-trunk #1756 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1756/)
        HDFS-6236. ImageServlet should use Time#monotonicNow to measure latency. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1586902)

        • /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/server/namenode/ImageServlet.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java
        Show
        Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #1756 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1756/ ) HDFS-6236 . ImageServlet should use Time#monotonicNow to measure latency. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1586902 ) /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/server/namenode/ImageServlet.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java

          People

          • Assignee:
            Chris Nauroth
            Reporter:
            Chris Nauroth
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development