Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-2034

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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.

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

        Activity

        John George created issue -
        John George made changes -
        Field Original Value New Value
        Attachment HDFS-2034.patch [ 12481436 ]
        John George made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        John George made changes -
        Summary reading from currently being written block does not work length in getBlockRange becomes -ve when reading only from currently being written blk
        Priority Major [ 3 ] Minor [ 4 ]
        John George made changes -
        Attachment HDFS-2034-1.patch [ 12481587 ]
        John George made changes -
        Attachment HDFS-2034-1.patch [ 12481588 ]
        John George made changes -
        Attachment HDFS-2034-2.patch [ 12481607 ]
        John George made changes -
        Attachment HDFS-2034-3.patch [ 12481616 ]
        Todd Lipcon made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        John George made changes -
        Attachment HDFS-2034-4.patch [ 12483073 ]
        John George made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        John George made changes -
        Attachment HDFS-2034-5.patch [ 12485740 ]
        Tsz Wo Nicholas Sze made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Fix Version/s 0.23.0 [ 12315571 ]
        Resolution Fixed [ 1 ]
        Tsz Wo Nicholas Sze made changes -
        Component/s hdfs client [ 12312928 ]
        Arun C Murthy made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development