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

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

                Author: ASF GitHub Bot
            Created on: 24/Jun/21 16:49
            Start Date: 24/Jun/21 16:49
    Worklog Time Spent: 10m 
      Work Description: coufon commented on a change in pull request #2421:
URL: https://github.com/apache/hive/pull/2421#discussion_r658120606



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
##########
@@ -5088,10 +5089,8 @@ private boolean isDatabaseRemote(String name) {
 
   private void deleteParentRecursive(Path parent, int depth, boolean 
mustPurge, boolean needRecycle)

Review comment:
       I think it works if deleteDir fails when the dir is non-empty with no 
side effect. But we need to make sure all filesystems that Hive supports work 
in this way. Also I noticed that deleteDir calls moveToTrash first, so it could 
be more complex: 
https://github.com/apache/hive/blob/f2de30ca8bc2b63887496775f9a0769057a17ee0/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreFsImpl.java#L41.
 Avoiding duplicated checks seems to be safer.




-- 
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: 614614)
    Time Spent: 50m  (was: 40m)

> Slow Hive partition deletion for Cloud object stores with expensive ListFiles
> -----------------------------------------------------------------------------
>
>                 Key: HIVE-25277
>                 URL: https://issues.apache.org/jira/browse/HIVE-25277
>             Project: Hive
>          Issue Type: Improvement
>          Components: Standalone Metastore
>    Affects Versions: All Versions
>            Reporter: Zhou Fang
>            Assignee: Zhou Fang
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Deleting a Hive partition is slow when use a Cloud object store as the 
> warehouse for which ListFiles is expensive. A root cause is that the 
> recursive parent dir deletion is very inefficient: there are many duplicated 
> calls to isEmpty (ListFiles is called at the end). This fix sorts the parents 
> to delete according to the path size, and always processes the longest one 
> (e.g., a/b/c is always before a/b). As a result, each parent path is only 
> needed to be checked once.



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

Reply via email to