Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-1907

BlockMissingException upon concurrent read and write: reader was doing file position read while writer is doing write without hflush

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.23.0
    • 0.23.0
    • hdfs-client
    • None
    • Run on a real cluster. Using the latest 0.23 build.

    • Reviewed

    Description

      BlockMissingException is thrown under this test scenario:
      Two different processes doing concurrent file r/w: one read and the other write on the same file

      • writer keep doing file write
      • reader doing position file read from beginning of the file to the visible end of file, repeatedly

      The reader is basically doing:
      byteRead = in.read(currentPosition, buffer, 0, byteToReadThisRound);
      where CurrentPostion=0, buffer is a byte array buffer, byteToReadThisRound = 1024*10000;

      Usually it does not fail right away. I have to read, close file, re-open the same file a few times to create the problem. I'll pose a test program to repro this problem after I've cleaned up a bit my current test program.

      Attachments

        1. HDFS-1907-5.patch
          2 kB
          John George
        2. HDFS-1907-5.patch
          2 kB
          John George
        3. HDFS-1907-4.patch
          2 kB
          John George
        4. HDFS-1907-3.patch
          3 kB
          John George
        5. HDFS-1907-2.patch
          3 kB
          John George
        6. HDFS-1907.patch
          1 kB
          John George

        Issue Links

          Activity

            People

              johnvijoe John George
              cwchung CW Chung
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: