You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Alexander Kolbasov (JIRA)" <ji...@apache.org> on 2017/10/19 19:11:00 UTC

[jira] [Created] (HIVE-17849) alterPartition() may fail to rollback transaction

Alexander Kolbasov created HIVE-17849:
-----------------------------------------

             Summary: 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


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
(v6.4.14#64029)