Hadoop Common
  1. Hadoop Common
  2. HADOOP-4228

dfs datanode metrics, bytes_read, bytes_written overflows due to incorrect type used.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.18.2, 0.19.0
    • Fix Version/s: 0.18.2
    • Component/s: metrics
    • Labels:
      None
    • Environment:

      Red Hat Enterprise Linux AS release 4 (Nahant Update 5), Java 1.6.

    • Hadoop Flags:
      Incompatible change, Reviewed
    • Release Note:
      Changed bytes_read, bytes_written to type long to prevent metrics overflow.

      Description

      bytes_read, and bytes_written metrics are using int (MetricsTimeVaryingInt) as counter. This type is too small to store the bytes_read and bytes_written metrics. Recommend to change this to long (metricsLongValue).

      1. metricsLong1-br18.patch
        6 kB
        Hairong Kuang
      2. metricsLong1.patch
        6 kB
        Hairong Kuang
      3. metricsLong.patch
        6 kB
        Hairong Kuang
      4. HADOOP-4228-trunk.patch
        11 kB
        Eric Yang
      5. HADOOP-4228.patch
        10 kB
        Eric Yang

        Activity

        Hide
        Hudson added a comment -

        Integrated in Hadoop-trunk #632 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/632/)
        . The type of dfs datanoe metrics, bytes_read and bytes_written, is changed to be long. Contributed by Eric Yang and Hairong Kuang.

        Show
        Hudson added a comment - Integrated in Hadoop-trunk #632 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/632/ ) . The type of dfs datanoe metrics, bytes_read and bytes_written, is changed to be long. Contributed by Eric Yang and Hairong Kuang.
        Hide
        Hairong Kuang added a comment -

        I just committed this. Thanks Eric!

        Show
        Hairong Kuang added a comment - I just committed this. Thanks Eric!
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12391556/metricsLong1.patch
        against trunk revision 703609.

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

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

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

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 Eclipse classpath. The patch retains Eclipse classpath integrity.

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

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

        Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3442/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3442/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3442/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3442/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/12391556/metricsLong1.patch against trunk revision 703609. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 Eclipse classpath. The patch retains Eclipse classpath integrity. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3442/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3442/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3442/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3442/console This message is automatically generated.
        Hide
        Hairong Kuang added a comment -

        Resubmit the patch since the hudson patch process is back.

        Show
        Hairong Kuang added a comment - Resubmit the patch since the hudson patch process is back.
        Hide
        Eric Yang added a comment -

        +1 for Hairong's patch. The patch provides real test cases.

        Show
        Eric Yang added a comment - +1 for Hairong's patch. The patch provides real test cases.
        Hide
        Hairong Kuang added a comment -

        Thank Brian for submitting a patch to HADOOP-4137 for handling Long type in Ganglia context. I am resubmitting my patch to hudson.

        Show
        Hairong Kuang added a comment - Thank Brian for submitting a patch to HADOOP-4137 for handling Long type in Ganglia context. I am resubmitting my patch to hudson.
        Hide
        Mac Yang added a comment -

        > Ganglia has no Long type - perhaps a solution would be to map Longs in Ganglia to a float?

        Short of supporting the Long data type, this seems like a reasonable thing to do.

        Brian, would you mind coming up with the patch for the Ganglia context?

        Show
        Mac Yang added a comment - > Ganglia has no Long type - perhaps a solution would be to map Longs in Ganglia to a float? Short of supporting the Long data type, this seems like a reasonable thing to do. Brian, would you mind coming up with the patch for the Ganglia context?
        Hide
        Brian Bockelman added a comment -

        Changing the type to Long breaks Ganglia metrics reporting (there's a static mapping of Java type -> Ganglia type; there's no current Long type, meaning the map returns null and causes a NPE).

        Ganglia has no Long type - perhaps a solution would be to map Longs in Ganglia to a float?

        See also:
        HADOOP-4137
        HADOOP-3422

        Show
        Brian Bockelman added a comment - Changing the type to Long breaks Ganglia metrics reporting (there's a static mapping of Java type -> Ganglia type; there's no current Long type, meaning the map returns null and causes a NPE). Ganglia has no Long type - perhaps a solution would be to map Longs in Ganglia to a float? See also: HADOOP-4137 HADOOP-3422
        Hide
        Hairong Kuang added a comment -

        This is a patch for the trunk. It removes the change to DFSTestUtil that caused the failed tests.

        Show
        Hairong Kuang added a comment - This is a patch for the trunk. It removes the change to DFSTestUtil that caused the failed tests.
        Hide
        Hairong Kuang added a comment -

        This is a patch for branch 18.

        Show
        Hairong Kuang added a comment - This is a patch for branch 18.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12391383/metricsLong.patch
        against trunk revision 701476.

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

        +1 tests included. The patch appears to include 6 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

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

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 Eclipse classpath. The patch retains Eclipse classpath integrity.

        -1 core tests. The patch failed core unit tests.

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

        Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3431/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3431/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3431/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3431/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/12391383/metricsLong.patch against trunk revision 701476. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 6 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 Eclipse classpath. The patch retains Eclipse classpath integrity. -1 core tests. The patch failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3431/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3431/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3431/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3431/console This message is automatically generated.
        Hide
        Sanjay Radia added a comment -

        +1

        Show
        Sanjay Radia added a comment - +1
        Hide
        Hairong Kuang added a comment -

        This patch has the following changes:
        1. DataNode's metrics bytesRead & bytesWritten are changed to be long;
        2. Add getBytesWritten method to DataNodesStaticsticsMBean;
        3. Add a unit test to see if DataNodeMetrics can handle long number of bytes written.

        Show
        Hairong Kuang added a comment - This patch has the following changes: 1. DataNode's metrics bytesRead & bytesWritten are changed to be long; 2. Add getBytesWritten method to DataNodesStaticsticsMBean; 3. Add a unit test to see if DataNodeMetrics can handle long number of bytes written.
        Hide
        Hairong Kuang added a comment -

        The SimulatedDataNodeMetrics seems quite dummy, which is introduced for only the testing purpose.

        A side note: DataNodeStatics and DataNodeStaticsMBean collect bytesRead but not bytesWritten. They should collect metrics bytesWritten as well.

        Show
        Hairong Kuang added a comment - The SimulatedDataNodeMetrics seems quite dummy, which is introduced for only the testing purpose. A side note: DataNodeStatics and DataNodeStaticsMBean collect bytesRead but not bytesWritten. They should collect metrics bytesWritten as well.
        Hide
        Eric Yang added a comment -

        The failed test has no relationship to this patch. There is probably something else committed to trunk which caused Balancer test failure.

        Show
        Eric Yang added a comment - The failed test has no relationship to this patch. There is probably something else committed to trunk which caused Balancer test failure.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12390702/HADOOP-4228-trunk.patch
        against trunk revision 697306.

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

        +1 tests included. The patch appears to include 6 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

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

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        -1 core tests. The patch failed core unit tests.

        -1 contrib tests. The patch failed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3349/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3349/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3349/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3349/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/12390702/HADOOP-4228-trunk.patch against trunk revision 697306. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 6 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. -1 core tests. The patch failed core unit tests. -1 contrib tests. The patch failed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3349/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3349/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3349/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3349/console This message is automatically generated.
        Hide
        Eric Yang added a comment -

        Same patch for trunk.

        Show
        Eric Yang added a comment - Same patch for trunk.
        Hide
        Eric Yang added a comment -

        Patch to change bytes_read and bytes_written metrics from type Integer to type long.

        Show
        Eric Yang added a comment - Patch to change bytes_read and bytes_written metrics from type Integer to type long.
        Hide
        Eric Yang added a comment -

        Patch to change metrics type from Integer to Long.

        Show
        Eric Yang added a comment - Patch to change metrics type from Integer to Long.

          People

          • Assignee:
            Eric Yang
            Reporter:
            Eric Yang
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development