Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-445

pread() fails when cached block locations are no longer valid

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.20-append
    • Fix Version/s: 0.20-append, 0.21.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      when cached block locations are no longer valid (e.g., datanodes restart on different ports), pread() will fail, whereas normal read() still succeeds through re-fetching of block locations from namenode (up to a max number of times).

      1. 445-06.patch
        7 kB
        Kan Zhang
      2. 445-08.patch
        9 kB
        Kan Zhang
      3. HDFS-445-0_20.2.patch
        10 kB
        Jitendra Nath Pandey
      4. hdfs-445-0.20-append.txt
        8 kB
        Todd Lipcon

        Activity

        Hide
        Kan Zhang added a comment -

        the attached patch changed chooseDataNode() to return a new location from newly fetched list from namenode.

        Show
        Kan Zhang added a comment - the attached patch changed chooseDataNode() to return a new location from newly fetched list from namenode.
        Hide
        Kan Zhang added a comment -

        attaching a new patch, which added a line at the beginning of the while loop in fetchBlockByteRange() to always get the latest block locations from cache. Also, removed old fetchBlockAt() and renamed fetchAndCacheBlockAt() to fetchBlockAt(). Always cache block locations when fetching. Thank Raghu for comments and discussions.

        Show
        Kan Zhang added a comment - attaching a new patch, which added a line at the beginning of the while loop in fetchBlockByteRange() to always get the latest block locations from cache. Also, removed old fetchBlockAt() and renamed fetchAndCacheBlockAt() to fetchBlockAt(). Always cache block locations when fetching. Thank Raghu for comments and discussions.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12411956/445-08.patch
        against trunk revision 790733.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 6 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed core unit tests.

        -1 contrib tests. The patch failed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/0/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/0/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/0/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/0/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12411956/445-08.patch against trunk revision 790733. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 6 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. -1 contrib tests. The patch failed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/0/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/0/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/0/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hdfs-Patch-vesta.apache.org/0/console This message is automatically generated.
        Hide
        Raghu Angadi added a comment -

        +1. This is an important fix for clients that keep a file open for a long time (like HBase).

        Show
        Raghu Angadi added a comment - +1. This is an important fix for clients that keep a file open for a long time (like HBase).
        Hide
        Raghu Angadi added a comment -

        I just committed this. Thanks Kan.

        Show
        Raghu Angadi added a comment - I just committed this. Thanks Kan.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #23 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/23/)
        . pread() does not pick up changes to block locations. (Kan Zhang via rangadi)

        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #23 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/23/ ) . pread() does not pick up changes to block locations. (Kan Zhang via rangadi)
        Hide
        Jitendra Nath Pandey added a comment -

        Patch for Hadoop 20 added.

        Show
        Jitendra Nath Pandey added a comment - Patch for Hadoop 20 added.
        Hide
        Nicolas Spiegelberg added a comment -

        Issue appeared during HBase testing. This should be pulled into the branch-0.20-append branch.

        Show
        Nicolas Spiegelberg added a comment - Issue appeared during HBase testing. This should be pulled into the branch-0.20-append branch.
        Hide
        Todd Lipcon added a comment -

        Here's a patch against the current 0.20-append branch (probably about the same as Jitendra's)

        Show
        Todd Lipcon added a comment - Here's a patch against the current 0.20-append branch (probably about the same as Jitendra's)

          People

          • Assignee:
            Kan Zhang
            Reporter:
            Kan Zhang
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development