You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Sergey Shelukhin (JIRA)" <ji...@apache.org> on 2015/02/24 02:04:02 UTC

[jira] [Comment Edited] (HIVE-9741) Refactor MetaStoreDirectSql constructor by removing DB queries out of critical section

    [ https://issues.apache.org/jira/browse/HIVE-9741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14334192#comment-14334192 ] 

Sergey Shelukhin edited comment on HIVE-9741 at 2/24/15 1:02 AM:
-----------------------------------------------------------------

1) Why is setDbANSIMode called where it's called in ObjectStore? It should already be called in DirectSQL before each set of queries. Note that it only works for one connection internally, so it needs to be called in the same transaction is queries, calling it in ObjectStore doesn't make a lot of sense.

2) The detection changes need to be tested (manually is probably the only way to do it) with all the databases affected (mysql, oracle, mssql)


was (Author: sershe):
1) Why is setDbANSIMode called where it's called in ObjectStore? It should already be called in DirectSQL before each set of queries. Note that it only works for one connection internally, so it needs to be called in the same transaction is queries, calling it in ObjectStore doesn't make a lot of sense.

2) The detection changes need to be tested with all the databases affected (mysql, oracle, mssql)

> Refactor MetaStoreDirectSql constructor by removing DB queries out of critical 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.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 released 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 bypass ensureDbInit() and runTestQuery() in order to avoid DB queries within critical section of setConf.
> Here’s stack trace:
> MetaStoreDirectSql.determineDbType(...)
> MetaStoreDirectSql.MetaStoreDirectSql(...)
> ObjectStore.initialize(...)
> ObjectStore.setConf(…)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)