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

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

                Author: ASF GitHub Bot
            Created on: 27/Jul/22 08:51
            Start Date: 27/Jul/22 08:51
    Worklog Time Spent: 10m 
      Work Description: deniskuzZ commented on code in PR #3457:
URL: https://github.com/apache/hive/pull/3457#discussion_r930794617


##########
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java:
##########
@@ -598,6 +627,16 @@ public void rollbackTxn() throws LockException {
     }
   }
 
+  @Override
+  public void rollbackTxn(Context ctx) throws LockException {
+    try {
+      cleanupOutputDir(ctx);
+    } catch (TException e) {
+      throw new 
LockException(ErrorMsg.METASTORE_COMMUNICATION_FAILED.getMsg(), e);
+    }
+    rollbackTxn();

Review Comment:
   we should call rollback first, and then try the cleanup, if cleanup fails, 
we'll never mark a txn as aborted 





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

    Worklog Id:     (was: 795567)
    Time Spent: 5h 50m  (was: 5h 40m)

> Aborted/Cancelled CTAS operations must initiate cleanup of uncommitted data
> ---------------------------------------------------------------------------
>
>                 Key: HIVE-26414
>                 URL: https://issues.apache.org/jira/browse/HIVE-26414
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Sourabh Badhya
>            Assignee: Sourabh Badhya
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> When a CTAS query fails before creation of table and after writing the data, 
> the data is present in the directory and not cleaned up currently by the 
> cleaner or any other mechanism currently. This is because the cleaner 
> requires a table corresponding to what its cleaning. In order surpass such a 
> situation, we can directly pass the relevant information to the cleaner so 
> that such uncommitted data is deleted.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to