You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/03/17 23:37:54 UTC

[GitHub] [hive] ramesh0201 opened a new pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

ramesh0201 opened a new pull request #2086:
URL: https://github.com/apache/hive/pull/2086


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] t3rmin4t0r commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
t3rmin4t0r commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r596550656



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -523,6 +523,8 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
       final StatsUpdater su = computeStats ? StatsUpdater.init(ci, msc.findColumnsWithStats(
           CompactionInfo.compactionInfoToStruct(ci)), conf,
           runJobAsSelf(ci.runAs) ? ci.runAs : t.getOwner()) : null;
+      Path resultDir = QueryCompactor.Util.getCompactionResultDir(sd, tblValidWriteIds,

Review comment:
       make it final.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -523,6 +523,8 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
       final StatsUpdater su = computeStats ? StatsUpdater.init(ci, msc.findColumnsWithStats(
           CompactionInfo.compactionInfoToStruct(ci)), conf,
           runJobAsSelf(ci.runAs) ? ci.runAs : t.getOwner()) : null;
+      Path resultDir = QueryCompactor.Util.getCompactionResultDir(sd, tblValidWriteIds,

Review comment:
       Add a comment - that this is the path which the compactor is supposed to write to, including an example path + the fact that it has a _v<txn> in it

##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -2133,6 +2133,7 @@ private static void populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
     HIVETESTCURRENTTIMESTAMP("hive.test.currenttimestamp", null, "current timestamp for test", false),
     HIVETESTMODEROLLBACKTXN("hive.test.rollbacktxn", false, "For testing only.  Will mark every ACID transaction aborted", false),
     HIVETESTMODEFAILCOMPACTION("hive.test.fail.compaction", false, "For testing only.  Will cause CompactorMR to fail.", false),
+    HIVETESTMODEFAILAFTERCOMPACTION("hive.test.fail.after.compaction", false, "For testing only.  Will cause CompactorMR to fail all compacting.", false),

Review comment:
       Mention this fails after open txn + creating output files

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -555,6 +559,11 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
         LOG.error("Caught exception while trying to compact " + ci +
             ".  Marking failed to avoid repeated failures", e);
         markFailed(ci, e);
+        // remove the new directories created by compaction
+        if (resultDir != null) {
+          FileSystem fs = resultDir.getFileSystem(conf);
+          fs.delete(resultDir, true);

Review comment:
       see if there needs to be exists check

##########
File path: ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands3.java
##########
@@ -463,6 +463,44 @@ public void testCompactionAbort() throws Exception {
     runCleaner(hiveConf);
   }
 
+
+  @Test
+  public void testCompactionAbortLeftoverFiles() throws Exception {
+    MetastoreConf.setBoolVar(hiveConf, MetastoreConf.ConfVars.CREATE_TABLES_AS_ACID, true);
+    dropTable(new String[] {"T"});
+    //note: transaction names T1, T2, etc below, are logical, the actual txnid will be different
+    runStatementOnDriver("create table T (a int, b int) stored as orc");
+    runStatementOnDriver("insert into T values(0,2)");//makes delta_1_1 in T1
+    runStatementOnDriver("insert into T values(1,4)");//makes delta_2_2 in T2
+
+    //create failed compaction attempt so that compactor txn is aborted
+    HiveConf.setBoolVar(hiveConf, HiveConf.ConfVars.HIVETESTMODEFAILAFTERCOMPACTION, true);
+    runStatementOnDriver("alter table T compact 'major'");
+    runWorker(hiveConf);
+
+    TxnStore txnHandler = TxnUtils.getTxnStore(hiveConf);
+    ShowCompactResponse resp = txnHandler.showCompact(new ShowCompactRequest());
+    Assert.assertEquals("Unexpected number of compactions in history",
+        1, resp.getCompactsSize());
+    Assert.assertEquals("Unexpected 0th compaction state",
+        TxnStore.FAILED_RESPONSE, resp.getCompacts().get(0).getState());
+    GetOpenTxnsResponse openResp =  txnHandler.getOpenTxns();
+    Assert.assertEquals(openResp.toString(), 1, openResp.getOpen_txnsSize());
+    //check that the compactor txn is aborted
+    Assert.assertTrue(openResp.toString(), BitSet.valueOf(openResp.getAbortedBits()).get(0));
+
+    FileSystem fs = FileSystem.get(hiveConf);
+    Path warehousePath = new Path(getWarehouseDir());
+    FileStatus[] actualList = fs.listStatus(new Path(warehousePath + "/t"),
+        FileUtils.HIDDEN_FILES_PATH_FILTER);
+
+    String[] expectedList = new String[] {
+        "/t/delta_0000001_0000001_0000",
+        "/t/delta_0000002_0000002_0000",
+    };

Review comment:
       Add comment saying that we should not see a path which has "/t/base_00002_v*", so that nobody adds that here to "make a test pass"

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -555,6 +559,11 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
         LOG.error("Caught exception while trying to compact " + ci +
             ".  Marking failed to avoid repeated failures", e);
         markFailed(ci, e);
+        // remove the new directories created by compaction
+        if (resultDir != null) {
+          FileSystem fs = resultDir.getFileSystem(conf);
+          fs.delete(resultDir, true);

Review comment:
       Log.error above needs modification to say "going to delete output-path"




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pvargacl commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
pvargacl commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r596707252



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -545,6 +556,8 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
 
         heartbeater.cancel();
 
+        failAfterCompactionIfSetForTest();

Review comment:
       instead of introducing this test only code here, you could use Mockito.spy in the test and override verifyTableIdHasNotChanged to always throw exception, that would have the same effect (probably you need the change the visibility to protected)




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r597217616



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -545,6 +556,8 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
 
         heartbeater.cancel();
 
+        failAfterCompactionIfSetForTest();

Review comment:
       +1




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ merged pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
deniskuzZ merged pull request #2086:
URL: https://github.com/apache/hive/pull/2086


   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] rbalamohan commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
rbalamohan commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r596551097



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -523,6 +523,8 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
       final StatsUpdater su = computeStats ? StatsUpdater.init(ci, msc.findColumnsWithStats(
           CompactionInfo.compactionInfoToStruct(ci)), conf,
           runJobAsSelf(ci.runAs) ? ci.runAs : t.getOwner()) : null;
+      Path resultDir = QueryCompactor.Util.getCompactionResultDir(sd, tblValidWriteIds,

Review comment:
       Can you plz double check this, as the params can be diff depending on major/min/MM etc.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] klcopp commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
klcopp commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r598763036



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -555,6 +559,11 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
         LOG.error("Caught exception while trying to compact " + ci +
             ".  Marking failed to avoid repeated failures", e);
         markFailed(ci, e);
+        // remove the new directories created by compaction
+        if (resultDir != null) {
+          FileSystem fs = resultDir.getFileSystem(conf);
+          fs.delete(resultDir, true);

Review comment:
       Better: catch FileNotFoundExceptions




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r599703002



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -553,8 +563,18 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
         compactionTxn.wasSuccessful();
       } catch (Throwable e) {
         LOG.error("Caught exception while trying to compact " + ci +
-            ".  Marking failed to avoid repeated failures", e);
+            ". Deleting the result directories created by the compactor "+ resultDir +
+            " Marking failed to avoid repeated failures", e);
         markFailed(ci, e);
+        // remove the new directories created by compaction
+        if (resultDir != null) {

Review comment:
       FS operations should be wrapped with doAs:
   ```
    if (runJobAsSelf(ci.runAs)) {
           CLEANUP()
    } else {
           UserGroupInformation ugi = UserGroupInformation.createProxyUser(ci.runAs,UserGroupInformation.getLoginUser());
           ugi.doAs((PrivilegedExceptionAction<Object>) () -> CLEANUP() });
    }
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r599703002



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -553,8 +563,18 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
         compactionTxn.wasSuccessful();
       } catch (Throwable e) {
         LOG.error("Caught exception while trying to compact " + ci +
-            ".  Marking failed to avoid repeated failures", e);
+            ". Deleting the result directories created by the compactor "+ resultDir +
+            " Marking failed to avoid repeated failures", e);
         markFailed(ci, e);
+        // remove the new directories created by compaction
+        if (resultDir != null) {

Review comment:
       FS operations should be wrapped with doAs:
    if (runJobAsSelf(ci.runAs)) {
           CLEANUP()
         } else {
           UserGroupInformation ugi = UserGroupInformation.createProxyUser(ci.runAs,UserGroupInformation.getLoginUser());
           ugi.doAs((PrivilegedExceptionAction<Object>) () -> CLEANUP() });




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r599703002



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -553,8 +563,18 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
         compactionTxn.wasSuccessful();
       } catch (Throwable e) {
         LOG.error("Caught exception while trying to compact " + ci +
-            ".  Marking failed to avoid repeated failures", e);
+            ". Deleting the result directories created by the compactor "+ resultDir +
+            " Marking failed to avoid repeated failures", e);
         markFailed(ci, e);
+        // remove the new directories created by compaction
+        if (resultDir != null) {

Review comment:
       FS operations should be wrapped with doAs:
   ```
    if (runJobAsSelf(ci.runAs)) {
           CLEANUP()
         } else {
           UserGroupInformation ugi = UserGroupInformation.createProxyUser(ci.runAs,UserGroupInformation.getLoginUser());
           ugi.doAs((PrivilegedExceptionAction<Object>) () -> CLEANUP() });
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r597211444



##########
File path: ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands3.java
##########
@@ -463,6 +463,48 @@ public void testCompactionAbort() throws Exception {
     runCleaner(hiveConf);
   }
 
+
+  @Test
+  public void testCompactionAbortLeftoverFiles() throws Exception {
+    MetastoreConf.setBoolVar(hiveConf, MetastoreConf.ConfVars.CREATE_TABLES_AS_ACID, true);
+    
+    dropTable(new String[] {"T"});
+    //note: transaction names T1, T2, etc below, are logical, the actual txnid will be different
+    runStatementOnDriver("create table T (a int, b int) stored as orc");
+    runStatementOnDriver("insert into T values(0,2)");//makes delta_1_1 in T1
+    runStatementOnDriver("insert into T values(1,4)");//makes delta_2_2 in T2
+
+    //create failed compaction attempt so that compactor txn is aborted
+    HiveConf.setBoolVar(hiveConf, HiveConf.ConfVars.HIVETESTMODEFAILAFTERCOMPACTION, true);
+    runStatementOnDriver("alter table T compact 'major'");

Review comment:
       Please add a test to cover the MINOR compaction use case. 
   Note: current implementation doesn't handle delete deltas. Add an update statement in your test. You need to handle both delta and delete_delta directories. 




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r596828645



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -523,6 +524,15 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
       final StatsUpdater su = computeStats ? StatsUpdater.init(ci, msc.findColumnsWithStats(
           CompactionInfo.compactionInfoToStruct(ci)), conf,
           runJobAsSelf(ci.runAs) ? ci.runAs : t.getOwner()) : null;
+      // result directory for compactor to write new files
+      Path resultDir = null;
+      if (ci.type == CompactionType.MAJOR) {

Review comment:
       Could this be simplified to just: 
   Path resultDir = QueryCompactor.Util.getCompactionResultDir(sd, tblValidWriteIds, conf, 
                ci.type == CompactionType.MAJOR, false, false, null);




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r599703002



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -553,8 +563,18 @@ protected Boolean findNextCompactionAndExecute(boolean computeStats) throws Inte
         compactionTxn.wasSuccessful();
       } catch (Throwable e) {
         LOG.error("Caught exception while trying to compact " + ci +
-            ".  Marking failed to avoid repeated failures", e);
+            ". Deleting the result directories created by the compactor "+ resultDir +
+            " Marking failed to avoid repeated failures", e);
         markFailed(ci, e);
+        // remove the new directories created by compaction
+        if (resultDir != null) {

Review comment:
       FS operations should be wrapped with doAs:
   ```
    if (runJobAsSelf(ci.runAs)) {
           CLEANUP()
         } else {
           UserGroupInformation ugi = UserGroupInformation.createProxyUser(ci.runAs,UserGroupInformation.getLoginUser());
           ugi.doAs((PrivilegedExceptionAction<Object>) () -> CLEANUP() });
   }
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r597211444



##########
File path: ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands3.java
##########
@@ -463,6 +463,48 @@ public void testCompactionAbort() throws Exception {
     runCleaner(hiveConf);
   }
 
+
+  @Test
+  public void testCompactionAbortLeftoverFiles() throws Exception {
+    MetastoreConf.setBoolVar(hiveConf, MetastoreConf.ConfVars.CREATE_TABLES_AS_ACID, true);
+    
+    dropTable(new String[] {"T"});
+    //note: transaction names T1, T2, etc below, are logical, the actual txnid will be different
+    runStatementOnDriver("create table T (a int, b int) stored as orc");
+    runStatementOnDriver("insert into T values(0,2)");//makes delta_1_1 in T1
+    runStatementOnDriver("insert into T values(1,4)");//makes delta_2_2 in T2
+
+    //create failed compaction attempt so that compactor txn is aborted
+    HiveConf.setBoolVar(hiveConf, HiveConf.ConfVars.HIVETESTMODEFAILAFTERCOMPACTION, true);
+    runStatementOnDriver("alter table T compact 'major'");

Review comment:
       Please add a test to cover the MINOR compaction use case. 
   Note: current implementation doesn't handle delete deltas. Add an update statement in your test. You need to handle both delete and delete_delta directories 




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2086: HIVE-24900 Failed compaction does not cleanup the directories

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2086:
URL: https://github.com/apache/hive/pull/2086#discussion_r599412816



##########
File path: ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands3.java
##########
@@ -463,6 +463,48 @@ public void testCompactionAbort() throws Exception {
     runCleaner(hiveConf);
   }
 
+
+  @Test
+  public void testCompactionAbortLeftoverFiles() throws Exception {
+    MetastoreConf.setBoolVar(hiveConf, MetastoreConf.ConfVars.CREATE_TABLES_AS_ACID, true);
+    
+    dropTable(new String[] {"T"});
+    //note: transaction names T1, T2, etc below, are logical, the actual txnid will be different
+    runStatementOnDriver("create table T (a int, b int) stored as orc");
+    runStatementOnDriver("insert into T values(0,2)");//makes delta_1_1 in T1
+    runStatementOnDriver("insert into T values(1,4)");//makes delta_2_2 in T2
+
+    //create failed compaction attempt so that compactor txn is aborted
+    HiveConf.setBoolVar(hiveConf, HiveConf.ConfVars.HIVETESTMODEFAILAFTERCOMPACTION, true);
+    runStatementOnDriver("alter table T compact 'major'");

Review comment:
       Can't see in the test where do you produce delete deltas. Could you please add an "update" statement? 




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org