[ 
https://issues.apache.org/jira/browse/HIVE-23814?focusedWorklogId=457514&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-457514
 ]

ASF GitHub Bot logged work on HIVE-23814:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Jul/20 04:49
            Start Date: 11/Jul/20 04:49
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #1222:
URL: https://github.com/apache/hive/pull/1222#discussion_r453155258



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/DriverTxnHandler.java
##########
@@ -529,6 +529,34 @@ private void addTableFromEntity(Entity entity, Map<String, 
Table> tables) {
       .collect(Collectors.toList());
   }
 
+  void rollback(CommandProcessorException cpe) throws 
CommandProcessorException {
+    try {
+      releaseLocksAndCommitOrRollback(false);
+    } catch (LockException e) {
+      LOG.error("rollback() FAILED: " + cpe); //make sure not to loose
+      DriverUtils.handleHiveException(driverContext, e, 12, "Additional info 
in hive.log at \"rollback() FAILED\"");
+    }
+  }
+
+  void handleTransactionAfterExecution() throws CommandProcessorException {
+    try {
+      if (driverContext.getTxnManager().isImplicitTransactionOpen() ||
+          driverContext.getPlan().getOperation() == HiveOperation.COMMIT) {
+        releaseLocksAndCommitOrRollback(true);
+      } else if (driverContext.getPlan().getOperation() == 
HiveOperation.ROLLBACK) {
+        releaseLocksAndCommitOrRollback(false);
+      } else if (!driverContext.getTxnManager().isTxnOpen() &&
+          driverContext.getQueryState().getHiveOperation() == 
HiveOperation.REPLLOAD) {
+        // repl load during migration, commits the explicit txn and start some 
internal txns. Call
+        // releaseLocksAndCommitOrRollback to do the clean up.
+        releaseLocksAndCommitOrRollback(false);
+      }
+      // if none of the above is true, then txn (if there is one started) is 
not finished

Review comment:
       How could this happen? Maybe at least a debug level log would be good.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 457514)
    Time Spent: 1h 20m  (was: 1h 10m)

> Clean up Driver
> ---------------
>
>                 Key: HIVE-23814
>                 URL: https://issues.apache.org/jira/browse/HIVE-23814
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Hive
>            Reporter: Miklos Gergely
>            Assignee: Miklos Gergely
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Driver is now cut down to it's minimal size by extracting all of it's sub 
> tasks to separate classes. The rest should be cleaned up by
>  * moving out some smaller parts of the code to sub task and utility classes 
> wherever it is still possible
>  * cut large functions to meaningful and manageable parts
>  * re-order the functions to follow the order of processing
>  * fix checkstyle issues
>  



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

Reply via email to