From hdfs-issues-return-212341-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Fri Mar 9 01:40:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 95A6B18064C for ; Fri, 9 Mar 2018 01:40:05 +0100 (CET) Received: (qmail 57586 invoked by uid 500); 9 Mar 2018 00:40:04 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 57569 invoked by uid 99); 9 Mar 2018 00:40:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Mar 2018 00:40:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0F71AC7D48 for ; Fri, 9 Mar 2018 00:40:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id zp6WCTAWBVBG for ; Fri, 9 Mar 2018 00:40:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id C55485F24A for ; Fri, 9 Mar 2018 00:40:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D717CE0372 for ; Fri, 9 Mar 2018 00:40:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id C7B1A2541B for ; Fri, 9 Mar 2018 00:40:00 +0000 (UTC) Date: Fri, 9 Mar 2018 00:40:00 +0000 (UTC) From: "Dennis Huo (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-13056) Expose file-level composite CRCs in HDFS which are comparable across different instances/layouts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-13056?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1639= 2176#comment-16392176 ]=20 Dennis Huo commented on HDFS-13056: ----------------------------------- Variable-sized blocks within a file are indeed supported (though in your ex= amples there are still uniform blocksizes within a file except for last fil= e); in addition to your three examples, the following would also return the= same value as another example: # [1, 3, 2, 1] This is implemented by FileChecksumHelper always using block.getBlockSize()= as the data length for each block rather than assuming what the block size= should be, except for the last block, where I don't trust block.getBlockSi= ze(). In the last block, it turned out that some flows modified the reporte= d block-size in-place and others didn't so I just made sure to manually com= pute the correct number of bytes associated with the last block. There are constraints on chunk and cell sizes, but these are based on inher= ent constraints in the system rather than assumptions in my algorithm; cell= size must be uniform within a block group (but can vary in different block= groups within a single file), which is already a fundamental assumption in= striped reader anyways, and chunk size must be uniform within a block (whi= ch is also fundamental because block metadata doesn't have any way to indic= ate changes of bytes-per-crc midway through the block). > Expose file-level composite CRCs in HDFS which are comparable across diff= erent instances/layouts > -------------------------------------------------------------------------= ----------------------- > > Key: HDFS-13056 > URL: https://issues.apache.org/jira/browse/HDFS-13056 > Project: Hadoop HDFS > Issue Type: New Feature > Components: datanode, distcp, erasure-coding, federation, hdfs > Affects Versions: 3.0.0 > Reporter: Dennis Huo > Assignee: Dennis Huo > Priority: Major > Attachments: HDFS-13056-branch-2.8.001.patch, HDFS-13056-branch-2= .8.002.patch, HDFS-13056-branch-2.8.003.patch, HDFS-13056-branch-2.8.004.pa= tch, HDFS-13056-branch-2.8.005.patch, HDFS-13056-branch-2.8.poc1.patch, HDF= S-13056.001.patch, HDFS-13056.002.patch, HDFS-13056.003.patch, HDFS-13056.0= 03.patch, HDFS-13056.004.patch, HDFS-13056.005.patch, HDFS-13056.006.patch,= HDFS-13056.007.patch, HDFS-13056.008.patch, Reference_only_zhen_PPOC_hadoo= p2.6.X.diff, hdfs-file-composite-crc32-v1.pdf, hdfs-file-composite-crc32-v2= .pdf, hdfs-file-composite-crc32-v3.pdf > > > FileChecksum was first introduced in [https://issues-test.apache.org/jira= /browse/HADOOP-3981]=C2=A0and ever since then has remained defined as MD5-o= f-MD5-of-CRC, where per-512-byte chunk CRCs are already stored as part of d= atanode metadata, and the MD5 approach is used to=C2=A0compute an aggregate= value in a distributed manner, with individual datanodes computing the MD5= -of-CRCs per-block in parallel, and the HDFS client computing the second-le= vel MD5. > =C2=A0 > A shortcoming of this approach which is=C2=A0often brought up is the fact= that this FileChecksum is=C2=A0sensitive to the internal block-size and ch= unk-size configuration, and thus different HDFS=C2=A0files with different b= lock/chunk settings cannot be compared. More commonly, one might have diffe= rent HDFS clusters which use different block sizes, in which case any data = migration won't be able to use the FileChecksum for distcp's rsync function= ality or for verifying end-to-end data integrity (on top of low-level data = integrity checks applied at data transfer time). > =C2=A0 > This was also revisited in https://issues.apache.org/jira/browse/HDFS-843= 0=C2=A0during the addition of checksum support for striped erasure-coded fi= les; while there was some discussion of using CRC composability, it still u= ltimately settled on=C2=A0hierarchical MD5 approach, which=C2=A0also=C2=A0a= dds the problem that checksums of basic replicated files are not comparable= to striped files. > =C2=A0 > This feature proposes to add a "COMPOSITE-CRC" FileChecksum type which=C2= =A0uses CRC composition to remain completely chunk/block agnostic, and allo= ws comparison between striped vs replicated files, between different HDFS i= nstances, and possible even between HDFS and other=C2=A0external storage sy= stems. This feature can also be added in-place to be compatible with existi= ng block metadata, and doesn't need to change the normal path of chunk veri= fication, so is minimally invasive. This also means even large preexisting = HDFS deployments could adopt this feature to retroactively sync data. A det= ailed design document can be found here:=C2=A0https://storage.googleapis.co= m/dennishuo/hdfs-file-composite-crc32-v1.pdf -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org