Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 894AA200CF8 for ; Tue, 15 Aug 2017 14:21:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5621F16690D; Tue, 15 Aug 2017 12:21:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7FF2416690F for ; Tue, 15 Aug 2017 14:21:09 +0200 (CEST) Received: (qmail 73420 invoked by uid 500); 15 Aug 2017 12:21:08 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 73397 invoked by uid 99); 15 Aug 2017 12:21:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Aug 2017 12:21:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 383BAC0118 for ; Tue, 15 Aug 2017 12:21:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -98.702 X-Spam-Level: X-Spam-Status: No, score=-98.702 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_NUMSUBJECT=0.5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id cqLEYF1jMjnx for ; Tue, 15 Aug 2017 12:21:05 +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 0ECDF5FE6D for ; Tue, 15 Aug 2017 12:21:05 +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 A34F8E0EA7 for ; Tue, 15 Aug 2017 12:21:03 +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 B8C2521905 for ; Tue, 15 Aug 2017 12:21:01 +0000 (UTC) Date: Tue, 15 Aug 2017 12:21:01 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5660) Drill 1.10 queries fail due to Parquet Metadata "corruption" from DRILL-3867 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 15 Aug 2017 12:21:10 -0000 [ https://issues.apache.org/jira/browse/DRILL-5660?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1612= 7137#comment-16127137 ]=20 ASF GitHub Bot commented on DRILL-5660: --------------------------------------- Github user vdiravka commented on a diff in the pull request: https://github.com/apache/drill/pull/877#discussion_r133140000 =20 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/store/parq= uet/ParquetGroupScan.java --- @@ -974,8 +1005,17 @@ private int updateRowGroupInfo(long maxRecords) { public ParquetGroupScan clone(FileSelection selection) throws IOExce= ption { ParquetGroupScan newScan =3D new ParquetGroupScan(this); newScan.modifyFileSelection(selection); - newScan.setCacheFileRoot(selection.cacheFileRoot); - newScan.init(selection.getMetaContext()); + MetadataContext metaContext =3D selection.getMetaContext(); + if (metaContext =3D=3D null) { + metaContext =3D new MetadataContext(); + } + if (newScan.usedMetadataCache) { + newScan.setCacheFileRoot(selection.cacheFileRoot); --- End diff -- =20 Done > Drill 1.10 queries fail due to Parquet Metadata "corruption" from DRILL-3= 867 > -------------------------------------------------------------------------= --- > > Key: DRILL-5660 > URL: https://issues.apache.org/jira/browse/DRILL-5660 > Project: Apache Drill > Issue Type: Bug > Affects Versions: 1.11.0 > Reporter: Paul Rogers > Assignee: Vitalii Diravka > Labels: doc-impacting > Fix For: 1.12.0 > > > Drill recently accepted a PR for the following bug: > DRILL-3867: Store relative paths in metadata file > This PR turned out to have a flaw which affects version compatibility. > The DRILL-3867 PR changed the format of Parquet metadata files to store r= elative paths. All Drill servers after that PR create files with relative p= aths. But, the version number of the file is unchanged, so that older Drill= bits don't know that they can't understand the file. > Instead, if an older Drill tries to read the file, queries fail left and = right. Drill will resolve the paths, but does so relative to the user's HDF= S home directory, which is wrong. > What should have happened is that we should have bumped the parquet metad= ata file version number so that older Drillbits can=E2=80=99t read the file= . This ticket requests that we do that. > Now, one could argue that the lack of version number change is fine. Once= a user upgrades Drill, they won't use an old Drillbit. But, things are not= that simple: > * A developer tests a branch based on a pre-DRILL-3867 build on a cluster= in which metadata files have been created by a post-DRILL-3867 build. (Thi= s has already occurred multiple times in our shop.) > * A user tries to upgrade to Drill 1.11, finds an issue, and needs to rol= l back to Drill 1.10. Doing so will cause queries to fail due to seemingly-= corrupt metadata files. > * A user tries to do a rolling upgrade: running 1.11 on some servers, 1.1= 0 on others. Once a 1.11 server is installed, the metadata is updated ("cor= rupted" from the perspective of 1.10) and queries fail. > Standard practice in this scenario is to: > * Bump the file version number when the file format changes, and > * Software refuses to read files with a version newer than the software w= as designed for. > Of course, it is highly desirable that newer servers read old files, but = that is not the issue here. > *Main technical points of working of parquet metadata caching for now.* > Only process of reading the parquet metadata is changed (the process of w= riting isn't changed): > +1. Metadata files are valid:+ > Metadata objects are created by deserialization of parquet metadata files= in the process of creating ParquetGroupScan physical operator.=20 > All supported versions are stored in the "MetadataVersion.Constants" clas= s and in the Jackson annotations for Metadata.ParquetTableMetadataBase clas= s. > +2. Metadata files version isn't supported (created by newer Drill versio= n). Drill table has at least one metadata file of unsupported version:+ > JsonMappingException is obtained and swallowed without creating metadata = object. Error message is logged. The state is stored in MetadataContext, th= erefore further there will be no attempt to deserialize metadata file again= in context of performing current query. The physical plan will be created = without using parquet metadata caching. Warning message is logged for every= further check "is metadata corrupted". > +3. Drill table has at least one corrupted metadata file, which can't be = deserialized:+ > JsonParseException is obtained. Then the same behaviour as for the unsupp= orted version files. > +4. The metadata file was removed by other process:+ > FileNotFound is obtained. Then the same behaviour as for the unsupported = version files. > The new versions of metadata should be added in such manner: > 1. Increasing of the metadata major version if metadata structure is chan= ged. > 2. Increasing of the metadata minor version if only metadata content is c= hanged, but metadata structure is the same. > For the first case a new metadata structure (class) should be created (po= ssible an improvement of deserializing metadata files of any version into o= ne strucure by using special converting) > For the second case only annotation for the last metadata structure can b= e updated. > *Summary* > 1. Drill will read and use metadata files if files are valid, all present= and supported. Under supported we mean that files were created before and = under current Drill version. > 2. Drill will ignore reading metadata files if at least one file is missi= ng, empty, corrupted or unsupported. Under unsupported we mean files create= d after current Drill version. When metadata files are not used, warning me= ssage will be written to the logs. -- This message was sent by Atlassian JIRA (v6.4.14#64029)