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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.23.0
    • hdfs-client
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: