Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-5761

DataNode fails to validate integrity for checksum type NULL when DataNode recovers

    Details

    • Type: Bug Bug
    • Status: Patch Available
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: datanode
    • Labels:

      Description

      When DataNode is down during writing blocks, the blocks are not filinalized and the next time DataNode recovers, integrity validation will run.
      But if we use NULL for checksum algorithm (we can set NULL to dfs.checksum.type), DataNode will fail to validate integrity and cannot be up.

      The cause is in BlockPoolSlice#validateIntegrity.
      In the method, there is following code.

      long numChunks = Math.min(
                (blockFileLen + bytesPerChecksum - 1)/bytesPerChecksum, 
                (metaFileLen - crcHeaderLen)/checksumSize);
      

      When we choose NULL checksum, checksumSize is 0 so ArithmeticException will be thrown and DataNode cannot be up.

      1. HDFS-5761.patch
        1 kB
        Kousuke Saruta

        Activity

        Hide
        Kousuke Saruta added a comment -

        I've attached a patch for this issue.

        Show
        Kousuke Saruta added a comment - I've attached a patch for this issue.
        Hide
        Uma Maheswara Rao G added a comment -

        Thanks for filing a JIRA. I noticed this when I was looking the JIRA HDFS-5728.
        Actually validate integrity check not necessary when it is set to NULL. It should consider full file length as is.
        I think the below array becomes 0 length array when checksumSize 0?

        byte[] buf = new byte[lastChunkSize+checksumSize];
        

        So, how about just considering blockFileLength when crc type is NULL? Because crc is null now, so we need not care about integrity check with CRC file at all right.

        Show
        Uma Maheswara Rao G added a comment - Thanks for filing a JIRA. I noticed this when I was looking the JIRA HDFS-5728 . Actually validate integrity check not necessary when it is set to NULL. It should consider full file length as is. I think the below array becomes 0 length array when checksumSize 0? byte [] buf = new byte [lastChunkSize+checksumSize]; So, how about just considering blockFileLength when crc type is NULL? Because crc is null now, so we need not care about integrity check with CRC file at all right.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12622648/HDFS-5761.patch
        against trunk revision .

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

        -1 tests included. 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 javac. The applied patch does not increase the total number of javac compiler warnings.

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

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

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

        +1 core tests. The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/5865//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/5865//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/12622648/HDFS-5761.patch against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . 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 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/5865//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/5865//console This message is automatically generated.
        Hide
        Kousuke Saruta added a comment -

        Thanks for your comment, Uma.
        At first, I thought same as you.
        I thought it's good to branch the logic depending on whether checksum type is NULL or not.
        But, on second thought, BlockPoolSlice should not have logic which depends specific checksum algorithm.
        How to verify is responsibility of each checksum algorithm.

        Show
        Kousuke Saruta added a comment - Thanks for your comment, Uma. At first, I thought same as you. I thought it's good to branch the logic depending on whether checksum type is NULL or not. But, on second thought, BlockPoolSlice should not have logic which depends specific checksum algorithm. How to verify is responsibility of each checksum algorithm.
        Hide
        Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 14m 32s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 tests included 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 javac 7m 25s There were no new javac warning messages.
        +1 javadoc 9m 32s There were no new javadoc warning messages.
        +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 2m 12s There were no new checkstyle issues.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
        +1 install 1m 33s mvn install still works.
        +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse.
        +1 findbugs 3m 7s The patch does not introduce any new Findbugs (version 2.0.3) warnings.
        +1 native 3m 13s Pre-build of native portion
        -1 hdfs tests 165m 20s Tests failed in hadoop-hdfs.
            207m 55s  



        Reason Tests
        Failed unit tests hadoop.hdfs.TestCrcCorruption



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12622648/HDFS-5761.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / a319771
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/10723/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/10723/testReport/
        Java 1.7.0_55
        uname Linux asf902.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/10723/console

        This message was automatically generated.

        Show
        Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 14m 32s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. -1 tests included 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 javac 7m 25s There were no new javac warning messages. +1 javadoc 9m 32s There were no new javadoc warning messages. +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 2m 12s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 33s mvn install still works. +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse. +1 findbugs 3m 7s The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 native 3m 13s Pre-build of native portion -1 hdfs tests 165m 20s Tests failed in hadoop-hdfs.     207m 55s   Reason Tests Failed unit tests hadoop.hdfs.TestCrcCorruption Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12622648/HDFS-5761.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / a319771 hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/10723/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/10723/testReport/ Java 1.7.0_55 uname Linux asf902.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/10723/console This message was automatically generated.
        Hide
        Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 14m 32s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 tests included 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 javac 7m 29s There were no new javac warning messages.
        +1 javadoc 9m 38s There were no new javadoc warning messages.
        +1 release audit 0m 22s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 2m 10s There were no new checkstyle issues.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
        +1 install 1m 31s mvn install still works.
        +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse.
        +1 findbugs 3m 2s The patch does not introduce any new Findbugs (version 2.0.3) warnings.
        +1 native 3m 15s Pre-build of native portion
        +1 hdfs tests 165m 3s Tests passed in hadoop-hdfs.
            207m 39s  



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12622648/HDFS-5761.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / a319771
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/10746/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/10746/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/10746/console

        This message was automatically generated.

        Show
        Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 14m 32s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. -1 tests included 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 javac 7m 29s There were no new javac warning messages. +1 javadoc 9m 38s There were no new javadoc warning messages. +1 release audit 0m 22s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 2m 10s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 31s mvn install still works. +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse. +1 findbugs 3m 2s The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 native 3m 15s Pre-build of native portion +1 hdfs tests 165m 3s Tests passed in hadoop-hdfs.     207m 39s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12622648/HDFS-5761.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / a319771 hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/10746/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/10746/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/10746/console This message was automatically generated.

          People

          • Assignee:
            Kousuke Saruta
            Reporter:
            Kousuke Saruta
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:

              Development