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 2021/05/27 19:31:00 UTC

[jira] [Work logged] (HIVE-24135) Drop database doesn't delete directory in managed location

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

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

                Author: ASF GitHub Bot
            Created on: 27/May/21 19:30
            Start Date: 27/May/21 19:30
    Worklog Time Spent: 10m 
      Work Description: yongzhi commented on a change in pull request #1506:
URL: https://github.com/apache/hive/pull/1506#discussion_r640908620



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
##########
@@ -1917,6 +1923,12 @@ private void drop_database_core(RawStore ms, String catName,
             LOG.error("Failed to delete database directory: " + db.getLocationUri() +
                 " " + e.getMessage());
           }
+          try {
+            wh.deleteDir(wh.getDatabaseManagedPath(db), true, db);
+          } catch (Exception e) {
+            LOG.error("Failed to delete database directory: " + db.getLocationUri() +

Review comment:
       should we are more consistent with the delete behavior, throw exception here too (the same as line 1789), the same is for 1923




-- 
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


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

    Worklog Id:     (was: 603227)
    Time Spent: 40m  (was: 0.5h)

> Drop database doesn't delete directory in managed location
> ----------------------------------------------------------
>
>                 Key: HIVE-24135
>                 URL: https://issues.apache.org/jira/browse/HIVE-24135
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Karen Coppage
>            Assignee: Naveen Gangam
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Repro:
>  say the default managed location is managed/hive and the default external location is external/hive.
> {code:java}
> create database db1; -- creates: external/hive/db1.db
> create table db1.table1 (i int); -- creates: managed/hive/db1.db and  managed/hive/db1.db/table1
> drop database db1 cascade; -- removes : external/hive/db1.db and managed/hive/db1.db/table1
> {code}
> Problem: Directory managed/hive/db1.db remains.
> Since HIVE-22995, dbs have a managed (managedLocationUri) and an external location (locationUri). I think the issue is that HiveMetaStore.HMSHandler#drop_database_core deletes only the db directory in the external location.



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