From issues-return-51585-archive-asf-public=cust-asf.ponee.io@drill.apache.org Tue Apr 3 22:36:05 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 95D0618064D for ; Tue, 3 Apr 2018 22:36:04 +0200 (CEST) Received: (qmail 40132 invoked by uid 500); 3 Apr 2018 20:36:03 -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 40123 invoked by uid 99); 3 Apr 2018 20:36:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2018 20:36:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4697E1A0838 for ; Tue, 3 Apr 2018 20:36:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 5W_c0Xc9iPPD for ; Tue, 3 Apr 2018 20:36:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 6A2925F283 for ; Tue, 3 Apr 2018 20:36:01 +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 8F164E00A6 for ; Tue, 3 Apr 2018 20:36:00 +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 5265325611 for ; Tue, 3 Apr 2018 20:36:00 +0000 (UTC) Date: Tue, 3 Apr 2018 20:36:00 +0000 (UTC) From: "salim achouche (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-6202) Deprecate usage of IndexOutOfBoundsException to re-alloc vectors 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/DRILL-6202?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1642= 4555#comment-16424555 ]=20 salim achouche commented on DRILL-6202: --------------------------------------- This is my take on the Drill boundary checks: _*Short Term -*_ * Ideally, the Drill boundary checks should be always on as long as=C2=A0 ** The impact of a Drillbit process crash (or data corruption) is big sinc= e there is no built-in fault-tolerance ** The code is extensible and extensions are allowed to access direct memo= ry * Having said that, my priority would have been to minimize the cost assoc= iated with these checks instead of completely turning them off ** This is no different from Java's behavior with regard to array boundary= checks * How do we do that? Actually there are multiple strategies (which could b= e combined) ** Fine-grained checks *** Add boundary checks within +all+ DrillBuf data accessors *** =C2=A0Invoke the accessor API within a loop and ensure the JVM is able= to optimize the checks=C2=A0 **** This will help you answer the question(s) around whether we access DM= directly or through Netty=C2=A0 ** Caller overwrite *** Allow caller to disable checks that are deemed too expensive or not ea= sily optimizable by the HotSport (e.g., Reference Checks) *** This pattern works well for a centralized layer (e.g., Paul's accessor= framework) but not for extensions as they cannot be always trusted to do t= he right thing *** To mitigate this, we could always have an auxiliary flag that will for= ce execution of such checks if set; that is overwrite untrusted callers **** This should be done if a crash or corruption is observed ** Bulk Processing *** Bulk accessor APIs will allow +all the checks+ to be performed but wit= h a minimal cost (amortized) _*Long Term -*_ * With the new Accessor Framework in place all DM checks should be primari= ly within this layer ** The promise of this layer is that other memory formats can be transpare= ntly substituted (e.g., Apache Arrow) * The question on whether the runtime checks are enabled by default become= s less important ** The chance of crash / corruption is highly minimized ** It should be rather easy for this layer to optimize the runtime checks;= then the question becomes "why not?" _*Question -*_ * Your Jira doesn't quite explain the ** "why" you intend to deprecate the IndexOutOfBoundException (since it is= an unchecked exception) ** And replace it with what other mechanism? =C2=A0 *NOTE -*=C2=A0 * To minimize bookkeeping complexity, Drill operators will upfront allocat= e memory for the variable length value vectors to minimize the cost of re-a= llocs * The setSafe() APIs are called (at least for Parquet) when the associated= column ** Has enough VV space to insert the new value(s) ** Can extend the current VV to the next-power-of-two; the setSafe() api i= s responsible for extending the vector(s) > Deprecate usage of IndexOutOfBoundsException to re-alloc vectors > ---------------------------------------------------------------- > > Key: DRILL-6202 > URL: https://issues.apache.org/jira/browse/DRILL-6202 > Project: Apache Drill > Issue Type: Bug > Reporter: Vlad Rozov > Assignee: Vlad Rozov > Priority: Major > Fix For: 1.14.0 > > > As bounds checking may be enabled or disabled, using IndexOutOfBoundsExce= ption to resize vectors is unreliable. It works only when bounds checking i= s enabled. -- This message was sent by Atlassian JIRA (v7.6.3#76005)