Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 2.7.3, 2.6.5, 3.0.0-alpha1
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In DFSInputStream::hedgedFetchBlockByteRange, during the first attempt, the passed-in buf from the caller is passed to another thread to fill. If the first attempt is timed out, the second attempt would be issued with another temp ByteBuffer. Now suppose the second attempt wins and the first attempt is blocked somewhere in the IO path. The second attempt's result would be copied to the buf provided by the caller and then caller would think the pread is all set. Later the caller might use the buf to do something else (for e.g. read another chunk of data), however, the first attempt in earlier hedgedFetchBlockByteRange might get some data and fill into the buf ...
      If this happens, the caller's buf would then be corrupted.

      To fix the issue, we should allocate a temp buf for the first attempt too.

      1. HDFS-10182-branch26.patch
        2 kB
        zhouyingchao
      2. HDFS-10182-001.patch
        2 kB
        zhouyingchao

        Activity

        Hide
        walter.k.su Walter Su added a comment -

        And because cancelAll(futures); doesn't interrupt the first attempt, and also don't wait for it to finish. Thanks zhouyingchao for reporting. The patch LGTM.

        Show
        walter.k.su Walter Su added a comment - And because cancelAll(futures); doesn't interrupt the first attempt, and also don't wait for it to finish. Thanks zhouyingchao for reporting. The patch LGTM.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 14s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 mvninstall 6m 48s trunk passed
        +1 compile 0m 26s trunk passed with JDK v1.8.0_74
        +1 compile 0m 28s trunk passed with JDK v1.7.0_95
        +1 checkstyle 0m 17s trunk passed
        +1 mvnsite 0m 34s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 1m 38s trunk passed
        +1 javadoc 0m 20s trunk passed with JDK v1.8.0_74
        +1 javadoc 0m 24s trunk passed with JDK v1.7.0_95
        +1 mvninstall 0m 32s the patch passed
        +1 compile 0m 23s the patch passed with JDK v1.8.0_74
        +1 javac 0m 23s the patch passed
        +1 compile 0m 26s the patch passed with JDK v1.7.0_95
        +1 javac 0m 26s the patch passed
        +1 checkstyle 0m 15s the patch passed
        +1 mvnsite 0m 31s the patch passed
        +1 mvneclipse 0m 10s the patch passed
        +1 whitespace 0m 0s Patch has no whitespace issues.
        +1 findbugs 1m 49s the patch passed
        +1 javadoc 0m 19s the patch passed with JDK v1.8.0_74
        +1 javadoc 0m 21s the patch passed with JDK v1.7.0_95
        +1 unit 0m 50s hadoop-hdfs-client in the patch passed with JDK v1.8.0_74.
        +1 unit 0m 55s hadoop-hdfs-client in the patch passed with JDK v1.7.0_95.
        +1 asflicense 0m 19s Patch does not generate ASF License warnings.
        20m 10s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:0ca8df7
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12794161/HDFS-10182-001.patch
        JIRA Issue HDFS-10182
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux c2151612853f 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / dc951e6
        Default Java 1.7.0_95
        Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_74 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_95
        findbugs v3.0.0
        JDK v1.7.0_95 Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/14864/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/14864/console
        Powered by Apache Yetus 0.2.0 http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 14s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 6m 48s trunk passed +1 compile 0m 26s trunk passed with JDK v1.8.0_74 +1 compile 0m 28s trunk passed with JDK v1.7.0_95 +1 checkstyle 0m 17s trunk passed +1 mvnsite 0m 34s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 38s trunk passed +1 javadoc 0m 20s trunk passed with JDK v1.8.0_74 +1 javadoc 0m 24s trunk passed with JDK v1.7.0_95 +1 mvninstall 0m 32s the patch passed +1 compile 0m 23s the patch passed with JDK v1.8.0_74 +1 javac 0m 23s the patch passed +1 compile 0m 26s the patch passed with JDK v1.7.0_95 +1 javac 0m 26s the patch passed +1 checkstyle 0m 15s the patch passed +1 mvnsite 0m 31s the patch passed +1 mvneclipse 0m 10s the patch passed +1 whitespace 0m 0s Patch has no whitespace issues. +1 findbugs 1m 49s the patch passed +1 javadoc 0m 19s the patch passed with JDK v1.8.0_74 +1 javadoc 0m 21s the patch passed with JDK v1.7.0_95 +1 unit 0m 50s hadoop-hdfs-client in the patch passed with JDK v1.8.0_74. +1 unit 0m 55s hadoop-hdfs-client in the patch passed with JDK v1.7.0_95. +1 asflicense 0m 19s Patch does not generate ASF License warnings. 20m 10s Subsystem Report/Notes Docker Image:yetus/hadoop:0ca8df7 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12794161/HDFS-10182-001.patch JIRA Issue HDFS-10182 Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux c2151612853f 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / dc951e6 Default Java 1.7.0_95 Multi-JDK versions /usr/lib/jvm/java-8-oracle:1.8.0_74 /usr/lib/jvm/java-7-openjdk-amd64:1.7.0_95 findbugs v3.0.0 JDK v1.7.0_95 Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/14864/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client Console output https://builds.apache.org/job/PreCommit-HDFS-Build/14864/console Powered by Apache Yetus 0.2.0 http://yetus.apache.org This message was automatically generated.
        Hide
        walter.k.su Walter Su added a comment -

        +1. I'll commit it shortly.

        Show
        walter.k.su Walter Su added a comment - +1. I'll commit it shortly.
        Hide
        walter.k.su Walter Su added a comment -

        Committed to trunk, branch-2, branch-2.8, branch-2.7.
        Hi, zhouyingchao. Would you mind upload a patch against branch-2.6?

        Show
        walter.k.su Walter Su added a comment - Committed to trunk, branch-2, branch-2.8, branch-2.7. Hi, zhouyingchao . Would you mind upload a patch against branch-2.6?
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #9510 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9510/)
        HDFS-10182. Hedged read might overwrite user's buf. Contributed by (waltersu4549: rev d8383c687c95dbb37effa307ab2d41497da1cfc2)

        • hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #9510 (See https://builds.apache.org/job/Hadoop-trunk-Commit/9510/ ) HDFS-10182 . Hedged read might overwrite user's buf. Contributed by (waltersu4549: rev d8383c687c95dbb37effa307ab2d41497da1cfc2) hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java
        Hide
        sinago zhouyingchao added a comment -

        Thank you for picking up the fix. I'll upload a patch against 2.6 ASAP.

        Show
        sinago zhouyingchao added a comment - Thank you for picking up the fix. I'll upload a patch against 2.6 ASAP.
        Hide
        sinago zhouyingchao added a comment -

        Patch of branch-2.6

        Show
        sinago zhouyingchao added a comment - Patch of branch-2.6
        Hide
        walter.k.su Walter Su added a comment -

        committed to branch-2.6

        Show
        walter.k.su Walter Su added a comment - committed to branch-2.6
        Hide
        vinodkv Vinod Kumar Vavilapalli added a comment -

        Closing the JIRA as part of 2.7.3 release.

        Show
        vinodkv Vinod Kumar Vavilapalli added a comment - Closing the JIRA as part of 2.7.3 release.

          People

          • Assignee:
            sinago zhouyingchao
            Reporter:
            sinago zhouyingchao
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development