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

length in getBlockRange becomes -ve when reading only from currently being written blk

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.23.0
    • Component/s: hdfs-client
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      This came up during HDFS-1907. Posting an example that Todd posted in HDFS-1907 that brought out this issue.

      Here's an example sequence to describe what I mean:
      1. open file, write one and a half blocks
      2. call hflush
      3. another reader asks for the first byte of the second block

      In this case since offset is greater than the completed block length, the math in getBlockRange() of DFSInputStreamer.java will set "length" to negative.

        Attachments

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

          Activity

            People

            • Assignee:
              johnvijoe John George
              Reporter:
              johnvijoe John George
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: