You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Carl Steinbach (JIRA)" <ji...@apache.org> on 2011/07/19 22:02:58 UTC

[jira] [Resolved] (HIVE-1679) MetaStore does not detect and rollback failed transactions

     [ https://issues.apache.org/jira/browse/HIVE-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Steinbach resolved HIVE-1679.
----------------------------------

       Resolution: Duplicate
    Fix Version/s: 0.7.0

Fixed in HIVE-1681.

> MetaStore does not detect and rollback failed transactions
> ----------------------------------------------------------
>
>                 Key: HIVE-1679
>                 URL: https://issues.apache.org/jira/browse/HIVE-1679
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 0.5.0, 0.6.0, 0.7.0
>            Reporter: Carl Steinbach
>             Fix For: 0.7.0
>
>
> Most of the methods in HiveMetaStore and ObjectStore adhere to the following idiom when 
> interacting with the ObjectStore:
> {code}
> boolean success = false;
> try {
>   ms.openTransaction();
>   /* do some stuff */
>   success = ms.commitTransaction();
> } finally {
>   if (!success) {
>     ms.rollbackTransaction();
>   }
> }
> {code}
> The problem with this is that ObjectStore.commitTransaction() always returns TRUE:
> {code}
>   public boolean commitTransaction() {
>     assert (openTrasactionCalls >= 1);
>     if (!currentTransaction.isActive()) {
>       throw new RuntimeException(
>           "Commit is called, but transaction is not active. Either there are"
>               + " mismatching open and close calls or rollback was called in the same trasaction");
>     }
>     openTrasactionCalls--;
>     if ((openTrasactionCalls == 0) && currentTransaction.isActive()) {
>       transactionStatus = TXN_STATUS.COMMITED;
>       currentTransaction.commit();
>     }
>     return true;
>   }
> {code}
> Consequently, the transaction appears to always succeed and ObjectStore is never
> directed to rollback transactions that have actually failed. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira