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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.23.0
    • Fix Version/s: 0.23.0
    • Component/s: hdfs-client
    • Labels:
      None
    • Environment:

      Run on a real cluster. Using the latest 0.23 build.

    • Hadoop Flags:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: