Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-5308

Shuffling to memory can get out-of-sync when fetching multiple compressed map outputs

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3-alpha, 0.23.8
    • Fix Version/s: 2.1.0-beta, 0.23.9
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      When a reducer is fetching multiple compressed map outputs from a host, the fetcher can get out-of-sync with the IFileInputStream, causing several of the maps to fail to fetch.

      This occurs because decompressors can return all the decompressed bytes before actually processing all the bytes in the compressed stream (due to checksums or other trailing data that we ignore). In the unfortunate case where these extra bytes cross an io.file.buffer.size boundary, some extra bytes will be left over and the next map_output will not fetch correctly (usually due to an invalid map_id).

      This scenario is not typically fatal to a job because the failure is charged to the map_output immediately following the "bad" one and the subsequent retry will normally work.

      1. MAPREDUCE-5308-branch-0.23.txt
        6 kB
        Nathan Roberts
      2. MAPREDUCE-5308.patch
        6 kB
        Nathan Roberts

        Activity

        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #1454 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1454/)
        MAPREDUCE-5308. Shuffling to memory can get out-of-sync when fetching multiple compressed map outputs. Contributed by Nathan Roberts (Revision 1491611)

        Result = SUCCESS
        jlowe : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1491611
        Files :

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/reduce/InMemoryMapOutput.java
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/task/reduce/TestFetcher.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1454 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1454/ ) MAPREDUCE-5308 . Shuffling to memory can get out-of-sync when fetching multiple compressed map outputs. Contributed by Nathan Roberts (Revision 1491611) Result = SUCCESS jlowe : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1491611 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/reduce/InMemoryMapOutput.java /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/task/reduce/TestFetcher.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Yarn-trunk #237 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/237/)
        MAPREDUCE-5308. Shuffling to memory can get out-of-sync when fetching multiple compressed map outputs. Contributed by Nathan Roberts (Revision 1491611)

        Result = SUCCESS
        jlowe : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1491611
        Files :

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/reduce/InMemoryMapOutput.java
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/task/reduce/TestFetcher.java
        Show
        Hudson added a comment - Integrated in Hadoop-Yarn-trunk #237 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/237/ ) MAPREDUCE-5308 . Shuffling to memory can get out-of-sync when fetching multiple compressed map outputs. Contributed by Nathan Roberts (Revision 1491611) Result = SUCCESS jlowe : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1491611 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/reduce/InMemoryMapOutput.java /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/task/reduce/TestFetcher.java
        Hide
        Jason Lowe added a comment -

        Thanks, Nathan! I committed this to trunk, branch-2, branch-2.1-beta and branch-0.23.

        Show
        Jason Lowe added a comment - Thanks, Nathan! I committed this to trunk, branch-2, branch-2.1-beta and branch-0.23.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-trunk-Commit #3891 (See https://builds.apache.org/job/Hadoop-trunk-Commit/3891/)
        MAPREDUCE-5308. Shuffling to memory can get out-of-sync when fetching multiple compressed map outputs. Contributed by Nathan Roberts (Revision 1491611)

        Result = SUCCESS
        jlowe : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1491611
        Files :

        • /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/reduce/InMemoryMapOutput.java
        • /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/task/reduce/TestFetcher.java
        Show
        Hudson added a comment - Integrated in Hadoop-trunk-Commit #3891 (See https://builds.apache.org/job/Hadoop-trunk-Commit/3891/ ) MAPREDUCE-5308 . Shuffling to memory can get out-of-sync when fetching multiple compressed map outputs. Contributed by Nathan Roberts (Revision 1491611) Result = SUCCESS jlowe : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1491611 Files : /hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/reduce/InMemoryMapOutput.java /hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/task/reduce/TestFetcher.java
        Hide
        Jason Lowe added a comment -

        +1, lgtm.

        Show
        Jason Lowe added a comment - +1, lgtm.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12586771/MAPREDUCE-5308-branch-0.23.txt
        against trunk revision .

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3750//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/12586771/MAPREDUCE-5308-branch-0.23.txt against trunk revision . -1 patch . The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3750//console This message is automatically generated.
        Hide
        Nathan Roberts added a comment -

        Verified fix on both trunk and 0.23 using the following 100MB terasort:

        • io.file.buffer.size set to 1024 (improves the likelihood of the problem occuring)
        • teragen with 1000000 records
        • terasort -Dmapred.max.split.size=1000000
        • Tested with DefaultCodec,GzipCodec,BzipCodec,DeflateCodec,Lz4Codec, and no-compression
        • Default, Gzip, Bzip, Deflate - all originally were able to reproduce the problem. With the fix there were no fetch failures in any of the cases.
        Show
        Nathan Roberts added a comment - Verified fix on both trunk and 0.23 using the following 100MB terasort: io.file.buffer.size set to 1024 (improves the likelihood of the problem occuring) teragen with 1000000 records terasort -Dmapred.max.split.size=1000000 Tested with DefaultCodec,GzipCodec,BzipCodec,DeflateCodec,Lz4Codec, and no-compression Default, Gzip, Bzip, Deflate - all originally were able to reproduce the problem. With the fix there were no fetch failures in any of the cases.
        Hide
        Nathan Roberts added a comment -

        Patch for branch-0.23

        Show
        Nathan Roberts added a comment - Patch for branch-0.23
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12586598/MAPREDUCE-5308.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. The javadoc tool did not generate any 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-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core.

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

        Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3746//testReport/
        Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3746//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/12586598/MAPREDUCE-5308.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 . The javadoc tool did not generate any 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-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3746//testReport/ Console output: https://builds.apache.org/job/PreCommit-MAPREDUCE-Build/3746//console This message is automatically generated.
        Hide
        Nathan Roberts added a comment -

        Patch fixes this issue by attempting to read() one additional byte from the input. This should always return EOF, but the side-effect is that it forces the decompressor to finish processing all of the compressed stream. This allows the IFileInputStream to stay in-sync and be completely processed (e.g. verification of IFileInputStream checksum) as part of this map_id. If we do get something other than EOF then something is truly wrong and we should fail this particular map.

        Show
        Nathan Roberts added a comment - Patch fixes this issue by attempting to read() one additional byte from the input. This should always return EOF, but the side-effect is that it forces the decompressor to finish processing all of the compressed stream. This allows the IFileInputStream to stay in-sync and be completely processed (e.g. verification of IFileInputStream checksum) as part of this map_id. If we do get something other than EOF then something is truly wrong and we should fail this particular map.
        Hide
        Nathan Roberts added a comment -

        Patch for trunk

        Show
        Nathan Roberts added a comment - Patch for trunk

          People

          • Assignee:
            Nathan Roberts
            Reporter:
            Nathan Roberts
          • Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development