Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-4933

MR1 final merge asks for length of file it just wrote before flushing it

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.1
    • 1.2.0
    • mrv1, task
    • None

    Description

      createKVIterator in ReduceTask contains the following code:

                try {
                  Merger.writeFile(rIter, writer, reporter, job);
                  addToMapOutputFilesOnDisk(fs.getFileStatus(outputPath));
                } catch (Exception e) {
                  if (null != outputPath) {
                    fs.delete(outputPath, true);
                  }
                  throw new IOException("Final merge failed", e);
                } finally {
                  if (null != writer) {
                    writer.close();
                  }
                }
      

      Merger#writeFile() does not close the file after writing it, so when fs.getFileStatus() is called on it, it may not return the correct length. This causes bad accounting further down the line, which can lead to map output data being lost.

      Attachments

        1. MAPREDUCE-4933-branch-1.patch
          1.0 kB
          Sandy Ryza

        Activity

          People

            sandyr Sandy Ryza
            sandyr Sandy Ryza
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: