You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/01/04 11:54:00 UTC

[jira] [Work logged] (HIVE-26904) QueryCompactor failed in commitCompaction if the tmp table dir is already removed

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

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

                Author: ASF GitHub Bot
            Created on: 04/Jan/23 11:53
            Start Date: 04/Jan/23 11:53
    Worklog Time Spent: 10m 
      Work Description: stiga-huang opened a new pull request, #3910:
URL: https://github.com/apache/hive/pull/3910

   <!--
   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.
   -->
   commitCompaction of query-based compactors just do some cleanup on tmp table dirs. It could fail if the tmp table dirs is already removed. See an example in https://issues.apache.org/jira/browse/IMPALA-11756
   It doesn't make sense to fail the compaction due to this.
   
   This PR catches the FileNotFoundException in commitCompaction() when the tmp table dir doesn't exist. Ignore and skip removing the dir, and don't fail the compaction.
   
   ### 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.
   -->
   The compaction is already finished so don't need to fail it if the tmp dirs are already cleaned up.
   
   ### 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'.
   -->
   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.
   -->
   Run existing tests.




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

            Worklog Id:     (was: 836871)
    Remaining Estimate: 0h
            Time Spent: 10m

> QueryCompactor failed in commitCompaction if the tmp table dir is already removed 
> ----------------------------------------------------------------------------------
>
>                 Key: HIVE-26904
>                 URL: https://issues.apache.org/jira/browse/HIVE-26904
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Quanlong Huang
>            Assignee: Quanlong Huang
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> commitCompaction() of query-based compactions just remove the dirs of tmp tables. It should not fail the compaction if the dirs are already removed.
> We've seen such a failure in Impala's test (IMPALA-11756):
> {noformat}
> 2023-01-02T02:09:26,306  INFO [HiveServer2-Background-Pool: Thread-695] ql.Driver: Executing command(queryId=jenkins_20230102020926_69112755-b783-4214-89e5-1c7111dfe15f): alter table partial_catalog_info_test.insert_only_partitioned partition (part=1) compact 'minor' and wait
> 2023-01-02T02:09:26,306  INFO [HiveServer2-Background-Pool: Thread-695] ql.Driver: Starting task [Stage-0:DDL] in serial mode
> 2023-01-02T02:09:26,317  INFO [HiveServer2-Background-Pool: Thread-695] exec.Task: Compaction enqueued with id 15
> ...
> 2023-01-02T02:12:55,849 ERROR [impala-ec2-centos79-m6i-4xlarge-ondemand-1428.vpc.cloudera.com-48_executor] compactor.Worker: Caught exception while trying to compact id:15,dbname:partial_catalog_info_test,tableName:insert_only_partitioned,partName:part=1,state:^@,type:MINOR,enqueueTime:0,start:0,properties:null,runAs:jenkins,tooManyAborts:false,hasOldAbort:false,highestWriteId:3,errorMessage:null,workerId: null,initiatorId: null,retryRetention0. Marking failed to avoid repeated failures
> java.io.FileNotFoundException: File hdfs://localhost:20500/tmp/hive/jenkins/092b533a-81c8-4b95-88e4-9472cf6f365d/_tmp_space.db/62ec04fb-e2d2-4a99-a454-ae709a3cccfe does not exist.
>         at org.apache.hadoop.hdfs.DistributedFileSystem$DirListingIterator.<init>(DistributedFileSystem.java:1275) ~[hadoop-hdfs-client-3.1.1.7.2.15.4-6.jar:?]
>         at org.apache.hadoop.hdfs.DistributedFileSystem$DirListingIterator.<init>(DistributedFileSystem.java:1249) ~[hadoop-hdfs-client-3.1.1.7.2.15.4-6.jar:?]
>         at org.apache.hadoop.hdfs.DistributedFileSystem$25.doCall(DistributedFileSystem.java:1194) ~[hadoop-hdfs-client-3.1.1.7.2.15.4-6.jar:?]
>         at org.apache.hadoop.hdfs.DistributedFileSystem$25.doCall(DistributedFileSystem.java:1190) ~[hadoop-hdfs-client-3.1.1.7.2.15.4-6.jar:?]
>         at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81) ~[hadoop-common-3.1.1.7.2.15.4-6.jar:?]
>         at org.apache.hadoop.hdfs.DistributedFileSystem.listLocatedStatus(DistributedFileSystem.java:1208) ~[hadoop-hdfs-client-3.1.1.7.2.15.4-6.jar:?]
>         at org.apache.hadoop.fs.FileSystem.listLocatedStatus(FileSystem.java:2144) ~[hadoop-common-3.1.1.7.2.15.4-6.jar:?]
>         at org.apache.hadoop.fs.FileSystem$5.<init>(FileSystem.java:2302) ~[hadoop-common-3.1.1.7.2.15.4-6.jar:?]
>         at org.apache.hadoop.fs.FileSystem.listFiles(FileSystem.java:2299) ~[hadoop-common-3.1.1.7.2.15.4-6.jar:?]
>         at org.apache.hadoop.hive.ql.txn.compactor.QueryCompactor$Util.cleanupEmptyDir(QueryCompactor.java:261) ~[hive-exec-3.1.3000.2022.0.13.0-60.jar:3.1.3000.2022.0.13.0-60]
>         at org.apache.hadoop.hive.ql.txn.compactor.MmMinorQueryCompactor.commitCompaction(MmMinorQueryCompactor.java:72) ~[hive-exec-3.1.3000.2022.0.13.0-60.jar:3.1.3000.2022.0.13.0-60]
>         at org.apache.hadoop.hive.ql.txn.compactor.QueryCompactor.runCompactionQueries(QueryCompactor.java:146) ~[hive-exec-3.1.3000.2022.0.13.0-60.jar:3.1.3000.2022.0.13.0-60]
>         at org.apache.hadoop.hive.ql.txn.compactor.MmMinorQueryCompactor.runCompaction(MmMinorQueryCompactor.java:63) ~[hive-exec-3.1.3000.2022.0.13.0-60.jar:3.1.3000.2022.0.13.0-60]
>         at org.apache.hadoop.hive.ql.txn.compactor.Worker.findNextCompactionAndExecute(Worker.java:435) ~[hive-exec-3.1.3000.2022.0.13.0-60.jar:3.1.3000.2022.0.13.0-60]
>         at org.apache.hadoop.hive.ql.txn.compactor.Worker.lambda$run$0(Worker.java:115) ~[hive-exec-3.1.3000.2022.0.13.0-60.jar:3.1.3000.2022.0.13.0-60]
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_261]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_261]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_261]
>         at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261]
> 2023-01-02T02:12:55,858  INFO [impala-ec2-centos79-m6i-4xlarge-ondemand-1428.vpc.cloudera.com-48_executor] compactor.Worker: Deleting result directories created by the compactor:2023-01-02T02:12:55,858  INFO [impala-ec2-centos79-m6i-4xlarge-ondemand-1428.vpc.cloudera.com-48_executor] compactor.Worker: hdfs://localhost:20500/test-warehouse/managed/partial_catalog_info_test.db/insert_only_partitioned/part=1/delta_0000001_0000003_v0001827
> 2023-01-02T02:12:55,859  INFO [impala-ec2-centos79-m6i-4xlarge-ondemand-1428.vpc.cloudera.com-48_executor] compactor.Worker: hdfs://localhost:20500/test-warehouse/managed/partial_catalog_info_test.db/insert_only_partitioned/part=1/delete_delta_0000001_0000003_v0001827
> 2023-01-02T02:12:55,859  INFO [impala-ec2-centos79-m6i-4xlarge-ondemand-1428.vpc.cloudera.com-48_executor] compactor.CompactionHeartbeatService: Stopping heartbeat task for TXN 1827
> 2023-01-02T02:12:55,859  INFO [impala-ec2-centos79-m6i-4xlarge-ondemand-1428.vpc.cloudera.com-48_executor] compactor.CompactionHeartbeatService$CompactionHeartbeater: Shutting down compaction txn heartbeater instance.
> 2023-01-02T02:12:55,859  INFO [impala-ec2-centos79-m6i-4xlarge-ondemand-1428.vpc.cloudera.com-48_executor] compactor.CompactionHeartbeatService$CompactionHeartbeater: Compaction txn heartbeater instance is successfully stopped.
> 2023-01-02T02:12:55,872  INFO [impala-ec2-centos79-m6i-4xlarge-ondemand-1428.vpc.cloudera.com-48] compactor.Worker: Worker thread finished one loop.
> 2023-01-02T02:12:55,872  INFO [impala-ec2-centos79-m6i-4xlarge-ondemand-1428.vpc.cloudera.com-48_executor] compactor.Worker: Processing compaction request null
> 2023-01-02T02:12:56,400  INFO [HiveServer2-Background-Pool: Thread-695] exec.Task: Compaction with id 15 finished with status: failed  {noformat}



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