Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-8607

TestFileCorruption doesn't work as expected

    Details

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

      Description

      Although it passes, it's useless.

       77  File[] blocks = data_dir.listFiles();
       78  assertTrue("Blocks do not exist in data-dir", (blocks != null) && (blocks.length > 0));
       79  for (int idx = 0; idx < blocks.length; idx++) {
       80    if (!blocks[idx].getName().startsWith(Block.BLOCK_FILE_PREFIX)) {
       81      continue;
       82    }
       83    System.out.println("Deliberately removing file "+blocks[idx].getName());
       84    assertTrue("Cannot remove file.", blocks[idx].delete());
       85  }
      

      blocks are located at finalized/subdir0/subdir0, but line 77 only returns "subdir0" because File.listFiles() is not recursive. So line 83~84 will never be excuted.

        Activity

        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk #2176 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2176/)
        HDFS-8607. TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2176 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2176/ ) HDFS-8607 . TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #228 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/228/)
        HDFS-8607. TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #228 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/228/ ) HDFS-8607 . TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #219 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/219/)
        HDFS-8607. TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #219 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/219/ ) HDFS-8607 . TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #2158 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2158/)
        HDFS-8607. TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2158 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2158/ ) HDFS-8607 . TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #230 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/230/)
        HDFS-8607. TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #230 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/230/ ) HDFS-8607 . TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk #960 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/960/)
        HDFS-8607. TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #960 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/960/ ) HDFS-8607 . TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #8017 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8017/)
        HDFS-8607. TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #8017 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8017/ ) HDFS-8607 . TestFileCorruption doesn't work as expected. (Contributed by Walter Su) (arp: rev 32ffda1266c11dd98ce7f439a89fce206adf751a) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCorruption.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        arpitagarwal Arpit Agarwal added a comment -

        Committed for 2.8.0. Thank you for reporting and fixing this Walter Su.

        Show
        arpitagarwal Arpit Agarwal added a comment - Committed for 2.8.0. Thank you for reporting and fixing this Walter Su .
        Hide
        arpitagarwal Arpit Agarwal added a comment -

        +1 for the patch, nice catch! Committing it shortly.

        Show
        arpitagarwal Arpit Agarwal added a comment - +1 for the patch, nice catch! Committing it shortly.
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        -1 pre-patch 5m 42s Findbugs (version ) appears to be broken on trunk.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 tests included 0m 0s The patch appears to include 1 new or modified test files.
        +1 javac 7m 31s There were no new javac warning messages.
        +1 release audit 0m 20s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 0m 50s There were no new checkstyle issues.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
        +1 install 1m 35s mvn install still works.
        +1 eclipse:eclipse 0m 31s The patch built with eclipse:eclipse.
        +1 findbugs 3m 16s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
        +1 native 1m 20s Pre-build of native portion
        +1 hdfs tests 161m 34s Tests passed in hadoop-hdfs.
            182m 43s  



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12739586/HDFS-8607.01.patch
        Optional Tests javac unit findbugs checkstyle
        git revision trunk / 4c5da9b
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/11357/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/11357/testReport/
        Java 1.7.0_55
        uname Linux asf900.gq1.ygridcore.net 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
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/11357/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment -1 pre-patch 5m 42s Findbugs (version ) appears to be broken on trunk. +1 @author 0m 0s The patch does not contain any @author tags. +1 tests included 0m 0s The patch appears to include 1 new or modified test files. +1 javac 7m 31s There were no new javac warning messages. +1 release audit 0m 20s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 0m 50s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 35s mvn install still works. +1 eclipse:eclipse 0m 31s The patch built with eclipse:eclipse. +1 findbugs 3m 16s The patch does not introduce any new Findbugs (version 3.0.0) warnings. +1 native 1m 20s Pre-build of native portion +1 hdfs tests 161m 34s Tests passed in hadoop-hdfs.     182m 43s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12739586/HDFS-8607.01.patch Optional Tests javac unit findbugs checkstyle git revision trunk / 4c5da9b hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/11357/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/11357/testReport/ Java 1.7.0_55 uname Linux asf900.gq1.ygridcore.net 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 Console output https://builds.apache.org/job/PreCommit-HDFS-Build/11357/console This message was automatically generated.
        Hide
        walter.k.su Walter Su added a comment -
        2015-06-15 17:02:35,962 WARN  hdfs.DFSClient (DFSInputStream.java:actualGetFromOneDataNode(1218)) - Connection failure: Failed to connect to /127.0.0.1:58508 for file /srcdat/nine/eight/5842207179401855738 for block BP-1622355698-9.96.1.34-1434358952058:blk_1073741833_1009:java.io.IOException: Got error, status message opReadBlock BP-1622355698-9.96.1.34-1434358952058:blk_1073741833_1009 received exception java.io.IOException: BlockId 1073741833 is not valid., for OP_READ_BLOCK, self=/127.0.0.1:43788, remote=/127.0.0.1:58508, for file /srcdat/nine/eight/5842207179401855738, for pool BP-1622355698-9.96.1.34-1434358952058 block 1073741833_1009 
        java.io.IOException: Got error, status message opReadBlock BP-1622355698-9.96.1.34-1434358952058:blk_1073741833_1009 received exception java.io.IOException: BlockId 1073741833 is not valid., for OP_READ_BLOCK, self=/127.0.0.1:43788, remote=/127.0.0.1:58508, for file /srcdat/nine/eight/5842207179401855738, for pool BP-1622355698-9.96.1.34-1434358952058 block 1073741833_1009
            at org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtoUtil.checkBlockOpStatus(DataTransferProtoUtil.java:140)
            at org.apache.hadoop.hdfs.RemoteBlockReader2.checkSuccess(RemoteBlockReader2.java:453)
            at org.apache.hadoop.hdfs.RemoteBlockReader2.newBlockReader(RemoteBlockReader2.java:421)
            at org.apache.hadoop.hdfs.BlockReaderFactory.getRemoteBlockReader(BlockReaderFactory.java:819)
            at org.apache.hadoop.hdfs.BlockReaderFactory.getRemoteBlockReaderFromTcp(BlockReaderFactory.java:698)
            at org.apache.hadoop.hdfs.BlockReaderFactory.build(BlockReaderFactory.java:358)
            at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:655)
            at org.apache.hadoop.hdfs.DFSInputStream.actualGetFromOneDataNode(DFSInputStream.java:1178)
            at org.apache.hadoop.hdfs.DFSInputStream.actualGetFromOneDataNode(DFSInputStream.java:1141)
            at org.apache.hadoop.hdfs.DFSInputStream.fetchBlockByteRange(DFSInputStream.java:1099)
        ...
        

        With the patch, we got the expected IOException and know it's properly handled.

        Show
        walter.k.su Walter Su added a comment - 2015-06-15 17:02:35,962 WARN hdfs.DFSClient (DFSInputStream.java:actualGetFromOneDataNode(1218)) - Connection failure: Failed to connect to /127.0.0.1:58508 for file /srcdat/nine/eight/5842207179401855738 for block BP-1622355698-9.96.1.34-1434358952058:blk_1073741833_1009:java.io.IOException: Got error, status message opReadBlock BP-1622355698-9.96.1.34-1434358952058:blk_1073741833_1009 received exception java.io.IOException: BlockId 1073741833 is not valid., for OP_READ_BLOCK, self=/127.0.0.1:43788, remote=/127.0.0.1:58508, for file /srcdat/nine/eight/5842207179401855738, for pool BP-1622355698-9.96.1.34-1434358952058 block 1073741833_1009 java.io.IOException: Got error, status message opReadBlock BP-1622355698-9.96.1.34-1434358952058:blk_1073741833_1009 received exception java.io.IOException: BlockId 1073741833 is not valid., for OP_READ_BLOCK, self=/127.0.0.1:43788, remote=/127.0.0.1:58508, for file /srcdat/nine/eight/5842207179401855738, for pool BP-1622355698-9.96.1.34-1434358952058 block 1073741833_1009 at org.apache.hadoop.hdfs.protocol.datatransfer.DataTransferProtoUtil.checkBlockOpStatus(DataTransferProtoUtil.java:140) at org.apache.hadoop.hdfs.RemoteBlockReader2.checkSuccess(RemoteBlockReader2.java:453) at org.apache.hadoop.hdfs.RemoteBlockReader2.newBlockReader(RemoteBlockReader2.java:421) at org.apache.hadoop.hdfs.BlockReaderFactory.getRemoteBlockReader(BlockReaderFactory.java:819) at org.apache.hadoop.hdfs.BlockReaderFactory.getRemoteBlockReaderFromTcp(BlockReaderFactory.java:698) at org.apache.hadoop.hdfs.BlockReaderFactory.build(BlockReaderFactory.java:358) at org.apache.hadoop.hdfs.DFSInputStream.getBlockReader(DFSInputStream.java:655) at org.apache.hadoop.hdfs.DFSInputStream.actualGetFromOneDataNode(DFSInputStream.java:1178) at org.apache.hadoop.hdfs.DFSInputStream.actualGetFromOneDataNode(DFSInputStream.java:1141) at org.apache.hadoop.hdfs.DFSInputStream.fetchBlockByteRange(DFSInputStream.java:1099) ... With the patch, we got the expected IOException and know it's properly handled.

          People

          • Assignee:
            walter.k.su Walter Su
            Reporter:
            walter.k.su Walter Su
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development