[ https://issues.apache.org/jira/browse/HIVE-22985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17054924#comment-17054924 ]
Peter Vary commented on HIVE-22985: ----------------------------------- [~klcopp]: I am not a big fan of sending an extra HMS call just to make sure that the transaction is aborted, or not. Shouldn't we just "unset" the compactorTxnId when aborted? Thanks, Peter > 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 > Priority: Major > Labels: compaction > Attachments: HIVE-22985.01.patch > > > 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)