hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hive QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-21028) get_table_meta should use a fetch plan to avoid race conditions ending up in NucleusObjectNotFoundException
Date Thu, 13 Dec 2018 05:12:00 GMT

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

Hive QA commented on HIVE-21028:
--------------------------------

| (/) *{color:green}+1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  0s{color} |
{color:green} The patch does not contain any @author tags. {color} |
|| || || || {color:brown} master Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  7m 54s{color}
| {color:green} master passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  0m 24s{color} |
{color:green} master passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m  7s{color}
| {color:green} master passed {color} |
| {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue}  1m  5s{color} | {color:blue}
standalone-metastore/metastore-server in master has 188 extant Findbugs warnings. {color}
|
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 17s{color} |
{color:green} master passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  0m 26s{color}
| {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green}  0m 25s{color} |
{color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green}  0m 25s{color} | {color:green}
the patch passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m  7s{color}
| {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} whitespace {color} | {color:green}  0m  0s{color}
| {color:green} The patch has no whitespace issues. {color} |
| {color:green}+1{color} | {color:green} findbugs {color} | {color:green}  1m  6s{color} |
{color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 18s{color} |
{color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 12s{color}
| {color:green} The patch does not generate ASF License warnings. {color} |
| {color:black}{color} | {color:black} {color} | {color:black} 12m 42s{color} | {color:black}
{color} |
\\
\\
|| Subsystem || Report/Notes ||
| Optional Tests |  asflicense  javac  javadoc  findbugs  checkstyle  compile  |
| uname | Linux hiveptest-server-upstream 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03)
x86_64 GNU/Linux |
| Build tool | maven |
| Personality | /data/hiveptest/working/yetus_PreCommit-HIVE-Build-15292/dev-support/hive-personality.sh
|
| git revision | master / a43581b |
| Default Java | 1.8.0_111 |
| findbugs | v3.0.0 |
| modules | C: standalone-metastore/metastore-server U: standalone-metastore/metastore-server
|
| Console output | http://104.198.109.242/logs//PreCommit-HIVE-Build-15292/yetus.txt |
| Powered by | Apache Yetus    http://yetus.apache.org |


This message was automatically generated.



> get_table_meta should use a fetch plan to avoid race conditions ending up in NucleusObjectNotFoundException
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-21028
>                 URL: https://issues.apache.org/jira/browse/HIVE-21028
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Karthik Manamcheri
>            Assignee: Karthik Manamcheri
>            Priority: Major
>         Attachments: HIVE-21028.1.patch
>
>
> The {{getTableMeta}} call retrieves the tables, loops through the tables and during this
loop it retrieves the database object to get the containing database name. DataNuclues does
a lazy retrieval and so, when the first call to get all the tables is done, it does not retrieve
the database objects.
> When this query is executed
> {code}query = pm.newQuery(MTable.class, filterBuilder.toString());
> {code}
> it loads all the tables, and when you do
> {code}
> table.getDatabase().getName()
> {code}
> it then goes and retrieves the database object.
> *However*, there could be another thread which actually has deleted the database!! If
this happens, we end up with exceptions such as
> {code}
> 2018-12-04 22:25:06,525 INFO  DataNucleus.Datastore.Retrieve: [pool-7-thread-191]: Object
with id "6930391[OID]org.apache.hadoop.hive.metastore.model.MTable" not found !
> 2018-12-04 22:25:06,527 WARN  DataNucleus.Persistence: [pool-7-thread-191]: Exception
thrown by StateManager.isLoaded
> No such database row
> org.datanucleus.exceptions.NucleusObjectNotFoundException: No such database row
> {code}
> We see this happen especially with calls which retrieve all the tables in all the databases
(basically a call to get_table_meta with dbNames="\*" and tableNames="\*").
> To avoid this, we can define a custom fetch plan and activate it only for the get_table_meta
query. This fetch plan would fetch the database object along with the MTable object.
> We would first create a fetch plan on the pmf
> {code}
> pmf.getFetchGroup(MTable.class, "mtable_db_fetch_group").addMember("database");
> {code}
> Then we use it just before calling the query
> {code}
> pm.getFetchPlan().addGroup("mtable_db_fetch_group");
> query = pm.newQuery(MTable.class, filterBuilder.toString());
> Collection<MTable> tables = (Collection<MTable>) query.executeWithArray(...);
> ...
> {code}
> Before the API call ends, we can remove the fetch plan by
> {code}
> pm.getFetchPlan().removeGroup("mtable_db_fetch_group");
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message