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

Szehon Ho commented on HIVE-4996:
---------------------------------

I think that most operations have read/write both, and the RetryingRawStore 
doesn't have enough context to tell whether the failing read has any writes 
before it, in which the rollback would affect.

Also , it doesn't get around the unbalanced problem.  As the first open() is 
not called again, so the final commit() would be unbalanced after any retry, 
read or write.

For example:
{code}
HMSHandler.createTable()
   ms.open()  //openTx = 1
   ms.getTable() // fails and rollback: set openTx = 0.  Then retries, openTx = 
1, then openTx = 0 on success.
   ms.createTable()  //openTx = 1 then openTx = 0.
   ms.commit();  //unbalanced transaction as activeTx = 0
{code}

In normal scenario:

{code}
HMSHandler.createTable()
   ms.open()  //openTx = 1
   ms.getTable() // openTx = 2, then openTx = 1
   ms.createTable()  //openTx = 2, then openTx = 1.
   ms.commit();  //openTx = 0
{code}

> unbalanced calls to openTransaction/commitTransaction
> -----------------------------------------------------
>
>                 Key: HIVE-4996
>                 URL: https://issues.apache.org/jira/browse/HIVE-4996
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 0.10.0, 0.11.0, 0.12.0
>         Environment: hiveserver1  Java HotSpot(TM) 64-Bit Server VM (build 
> 20.6-b01, mixed mode)
>            Reporter: wangfeng
>            Assignee: Szehon Ho
>            Priority: Critical
>              Labels: hive, metastore
>         Attachments: hive-4996.path
>
>   Original Estimate: 504h
>  Remaining Estimate: 504h
>
> when we used hiveserver1 based on hive-0.10.0, we found the Exception 
> thrown.It was:
> FAILED: Error in metadata: MetaException(message:java.lang.RuntimeException: 
> commitTransaction was called but openTransactionCalls = 0. This probably 
> indicates that the
> re are unbalanced calls to openTransaction/commitTransaction)
> FAILED: Execution Error, return code 1 from 
> org.apache.hadoop.hive.ql.exec.DDLTask
> help



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to