Karen Coppage created HIVE-22985:
------------------------------------

             Summary: Failed compaction always throws TxnAbortedException
                 Key: HIVE-22985
                 URL: https://issues.apache.org/jira/browse/HIVE-22985
             Project: Hive
          Issue Type: Bug
            Reporter: Karen Coppage
            Assignee: Karen Coppage


If compaction fails, its txn is aborted, however Worker attempts to commit it 
again in a finally statement. This results in a TxnAbortedException [1] thrown 
from TxnHandler#commitTxn

We need to add a check and only try to commit at the end if the txn is not 
aborted.(TxnHandler#commitTxn does nothing if txn is already committed.)

[1]
{code:java}
ERROR org.apache.hadoop.hive.metastore.RetryingHMSHandler - 
TxnAbortedException(message:Transaction txnid:16 already aborted)
        at 
org.apache.hadoop.hive.metastore.txn.TxnHandler.raiseTxnUnexpectedState(TxnHandler.java:4843)
        at 
org.apache.hadoop.hive.metastore.txn.TxnHandler.commitTxn(TxnHandler.java:1141)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.commit_txn(HiveMetaStore.java:8101)
...
        at 
org.apache.hadoop.hive.ql.txn.compactor.Worker.commitTxn(Worker.java:291)
        at org.apache.hadoop.hive.ql.txn.compactor.Worker.run(Worker.java:269)

{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to