Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha1
    • Fix Version/s: 3.0.0-alpha2
    • Component/s: erasure-coding
    • Labels:
      None

      Description

      In BlockManager#reportDiffSorted:

          } else if (reportedState == ReplicaState.FINALIZED &&
                     (storedBlock.findStorageInfo(storageInfo) == -1 ||
                      corruptReplicas.isReplicaCorrupt(storedBlock, dn))) {
            // Add replica if appropriate. If the replica was previously corrupt
            // but now okay, it might need to be updated.
            toAdd.add(new BlockInfoToAdd(storedBlock, replica));
          }
      

      "new BlockInfoToAdd(storedBlock, replica)" is wrong because "replica" (i.e., the reported block) is a reused object provided by BlockListAsLongs#iterator. Later this object is reused by directly changing its ID/GS. Thus addStoredBlock can get wrong (reportedBlock, stored-BlockInfo) mapping. For EC the reported block is used to calculate the internal block index. Thus the bug can completely corrupt the EC block group internal states.

        Issue Links

          Activity

          Hide
          jingzhao Jing Zhao added a comment -

          A simple fix is:

          @@ -2677,7 +2677,7 @@ private void reportDiffSortedInner(
                           corruptReplicas.isReplicaCorrupt(storedBlock, dn))) {
                 // Add replica if appropriate. If the replica was previously corrupt
                 // but now okay, it might need to be updated.
          -      toAdd.add(new BlockInfoToAdd(storedBlock, replica));
          +      toAdd.add(new BlockInfoToAdd(storedBlock, new Block(replica)));
               }
             }
          

          I will try to write a unit test for this and will upload a patch afterwards.

          Show
          jingzhao Jing Zhao added a comment - A simple fix is: @@ -2677,7 +2677,7 @@ private void reportDiffSortedInner( corruptReplicas.isReplicaCorrupt(storedBlock, dn))) { // Add replica if appropriate. If the replica was previously corrupt // but now okay, it might need to be updated. - toAdd.add( new BlockInfoToAdd(storedBlock, replica)); + toAdd.add( new BlockInfoToAdd(storedBlock, new Block(replica))); } } I will try to write a unit test for this and will upload a patch afterwards.
          Hide
          andrew.wang Andrew Wang added a comment -

          +1 LGTM, nice find Jing!

          Show
          andrew.wang Andrew Wang added a comment - +1 LGTM, nice find Jing!
          Hide
          hadoopqa Hadoop QA added a comment -
          -1 overall



          Vote Subsystem Runtime Comment
          0 reexec 0m 11s Docker mode activated.
          +1 @author 0m 0s The patch does not contain any @author tags.
          +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
          +1 mvninstall 7m 23s trunk passed
          +1 compile 0m 45s trunk passed
          +1 checkstyle 0m 27s trunk passed
          +1 mvnsite 0m 53s trunk passed
          +1 mvneclipse 0m 12s trunk passed
          +1 findbugs 1m 46s trunk passed
          +1 javadoc 0m 54s trunk passed
          +1 mvninstall 0m 49s the patch passed
          +1 compile 0m 41s the patch passed
          +1 javac 0m 41s the patch passed
          -0 checkstyle 0m 24s hadoop-hdfs-project/hadoop-hdfs: The patch generated 3 new + 127 unchanged - 0 fixed = 130 total (was 127)
          +1 mvnsite 0m 48s the patch passed
          +1 mvneclipse 0m 10s the patch passed
          +1 whitespace 0m 0s The patch has no whitespace issues.
          +1 findbugs 1m 45s the patch passed
          +1 javadoc 0m 52s the patch passed
          -1 unit 59m 2s hadoop-hdfs in the patch failed.
          +1 asflicense 0m 19s The patch does not generate ASF License warnings.
          78m 40s



          Reason Tests
          Failed junit tests hadoop.hdfs.TestFileCreationDelete



          Subsystem Report/Notes
          Docker Image:yetus/hadoop:9560f25
          JIRA Issue HDFS-10858
          JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12828116/HDFS-10858.000.patch
          Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
          uname Linux 4e221a08fe00 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 / 58ed4fa
          Default Java 1.8.0_101
          findbugs v3.0.0
          checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16716/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs.txt
          unit https://builds.apache.org/job/PreCommit-HDFS-Build/16716/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
          Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16716/testReport/
          modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
          Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16716/console
          Powered by Apache Yetus 0.4.0-SNAPSHOT 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 11s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 23s trunk passed +1 compile 0m 45s trunk passed +1 checkstyle 0m 27s trunk passed +1 mvnsite 0m 53s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 46s trunk passed +1 javadoc 0m 54s trunk passed +1 mvninstall 0m 49s the patch passed +1 compile 0m 41s the patch passed +1 javac 0m 41s the patch passed -0 checkstyle 0m 24s hadoop-hdfs-project/hadoop-hdfs: The patch generated 3 new + 127 unchanged - 0 fixed = 130 total (was 127) +1 mvnsite 0m 48s the patch passed +1 mvneclipse 0m 10s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 45s the patch passed +1 javadoc 0m 52s the patch passed -1 unit 59m 2s hadoop-hdfs in the patch failed. +1 asflicense 0m 19s The patch does not generate ASF License warnings. 78m 40s Reason Tests Failed junit tests hadoop.hdfs.TestFileCreationDelete Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HDFS-10858 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12828116/HDFS-10858.000.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 4e221a08fe00 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 / 58ed4fa Default Java 1.8.0_101 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16716/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs.txt unit https://builds.apache.org/job/PreCommit-HDFS-Build/16716/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16716/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16716/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
          Hide
          jingzhao Jing Zhao added a comment -

          Thanks for the review, Andrew Wang. The test failure was due to binding conflict and it can pass in my local machine. I've committed the patch.

          Show
          jingzhao Jing Zhao added a comment - Thanks for the review, Andrew Wang . The test failure was due to binding conflict and it can pass in my local machine. I've committed the patch.
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10429 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10429/)
          HDFS-10858. FBR processing may generate incorrect (jing9: rev 72dfb048a9a7be64b371b74478b90150bf300d35)

          • (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
          • (add) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAddStripedBlockInFBR.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10429 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10429/ ) HDFS-10858 . FBR processing may generate incorrect (jing9: rev 72dfb048a9a7be64b371b74478b90150bf300d35) (edit) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java (add) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestAddStripedBlockInFBR.java

            People

            • Assignee:
              jingzhao Jing Zhao
              Reporter:
              jingzhao Jing Zhao
            • Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development