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

FSEditLog.printStatistics may cause IndexOutOfBoundsException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.19.1
    • Fix Version/s: 0.19.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      jdk 1.6, centOS 5.2 and hadoop 0.19.1

    • Hadoop Flags:
      Reviewed

      Description

      We met IndexOutOfBoundsException exception when did logSync or rollEditlog,
      the direct reason is the printStatistics of FSEditLog used the first element of
      StringArray editStreams, but does not check whether editStreams is empty when
      it is not null. As below:

      if (editStreams == null )

      { return; }

      .....[snipped]....
      buf.append(" Number of syncs: " + editStreams.get(0).getNumSync());

      the simple solution is to check whether it is empty.

        Activity

        Hide
        gnawux Wang Xu added a comment -

        The patch will check if the StringArray is empty.

        Show
        gnawux Wang Xu added a comment - The patch will check if the StringArray is empty.
        Hide
        gnawux Wang Xu added a comment -

        check whether the editStreams is empty

        Show
        gnawux Wang Xu added a comment - check whether the editStreams is empty
        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        +1 patch looks good.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - +1 patch looks good.
        Hide
        hadoopqa Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12406234/editlog-printstatistics.patch
        against trunk revision 768376.

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

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no tests are needed for this patch.

        +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 release audit. The applied patch does not increase the total number of release audit warnings.

        +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-vesta.apache.org/241/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/241/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/241/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/241/console

        This message is automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12406234/editlog-printstatistics.patch against trunk revision 768376. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no tests are needed for this patch. +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 release audit. The applied patch does not increase the total number of release audit warnings. +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-vesta.apache.org/241/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/241/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/241/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/241/console This message is automatically generated.
        Hide
        johanoskarsson Johan Oskarsson added a comment -

        I just committed this. Thanks, Wang!

        Show
        johanoskarsson Johan Oskarsson added a comment - I just committed this. Thanks, Wang!

          People

          • Assignee:
            gnawux Wang Xu
            Reporter:
            gnawux Wang Xu
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.5h
              0.5h
              Remaining:
              Remaining Estimate - 0.5h
              0.5h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development