Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B13AB17389 for ; Wed, 25 Feb 2015 22:03:05 +0000 (UTC) Received: (qmail 53615 invoked by uid 500); 25 Feb 2015 22:03:05 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 53557 invoked by uid 500); 25 Feb 2015 22:03:05 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 53511 invoked by uid 99); 25 Feb 2015 22:03:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Feb 2015 22:03:05 +0000 Date: Wed, 25 Feb 2015 22:03:05 +0000 (UTC) From: "Sergey Shelukhin (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-9741) Refactor MetaStoreDirectSql constructor by removing DB queries out of critical section 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/HIVE-9741?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D14337= 307#comment-14337307 ]=20 Sergey Shelukhin commented on HIVE-9741: ---------------------------------------- Hi. What I'm asking is - why is setDbANSIMode necessary during init with th= ese changes? And logging is no longer valid at all since this method is no = longer used for verification. > Refactor MetaStoreDirectSql constructor by removing DB queries out of cri= tical section > -------------------------------------------------------------------------= ------------- > > Key: HIVE-9741 > URL: https://issues.apache.org/jira/browse/HIVE-9741 > Project: Hive > Issue Type: Bug > Components: Metastore > Affects Versions: 1.0.0 > Reporter: Xiaobing Zhou > Assignee: Xiaobing Zhou > Attachments: HIVE-9741.1.patch, HIVE-9741.2.patch, HIVE-9741.3.pa= tch, HIVE-9741.4.patch, HIVE-9741.5.patch > > > MetaStoreDirectSql constructor is querying DB to determine dbType, which = leads to too many DB queries to make megastore slow as ObjectStore.setConf = might be called frequently. Moreover, ObjectStore.setConf begins/ends with = lock acquire/release, if the underlying DB hangs somehow, lock is never rel= eased and all hereafter incoming requests are blocked. > Two points: > 1. Using getProductName based JDBC driver to get dbType info. > 2. Since metastore auto-creaton is disabled by default, it'd better bypas= s ensureDbInit() and runTestQuery() in order to avoid DB queries within cri= tical section of setConf. > Here=E2=80=99s stack trace: > MetaStoreDirectSql.determineDbType(...) > MetaStoreDirectSql.MetaStoreDirectSql(...) > ObjectStore.initialize(...) > ObjectStore.setConf(=E2=80=A6) -- This message was sent by Atlassian JIRA (v6.3.4#6332)