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

Alexander Kolbasov commented on HIVE-17849:
-------------------------------------------

This isn't a problem in Hive3, only in Hive2


> alterPartition() may fail to rollback transaction
> -------------------------------------------------
>
>                 Key: HIVE-17849
>                 URL: https://issues.apache.org/jira/browse/HIVE-17849
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 2.3.0
>            Reporter: Alexander Kolbasov
>            Assignee: Alexander Kolbasov
>            Priority: Major
>         Attachments: HIVE-17849.01-branch-2.3.patch
>
>
> In HiveAlterHandle.alterPartition() there is this code:
> {code}
>           try {
>             msdb.openTransaction();
>             msdb.alterPartition(dbname, name, new_part.getValues(), oldPart);
>             if (transactionalListeners != null && 
> !transactionalListeners.isEmpty()) {
>               MetaStoreListenerNotifier.notifyEvent(transactionalListeners,
>                                                     
> EventMessage.EventType.ALTER_PARTITION,
>                                                     new 
> AlterPartitionEvent(new_part, oldPart, tbl, success, handler));
>             }
>             revertMetaDataTransaction = msdb.commitTransaction();
>           } catch (Exception ex2) {
>             LOG.error("Attempt to revert partition metadata change failed. 
> The revert was attempted " +
>                 "because associated filesystem rename operation failed with 
> exception " + ex.getMessage(), ex2);
>             if (!revertMetaDataTransaction) {
>               msdb.rollbackTransaction();
>             }
>           }
> {code}
> Note that there is no {{finally}} clause, so it is possible for some 
> unchecked exception to occur in which case the transaction will remain 
> active. Once this happens, all subsequent transactions on this thread will 
> not behave correctly.



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

Reply via email to