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

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

                Author: ASF GitHub Bot
            Created on: 22/Mar/19 16:37
            Start Date: 22/Mar/19 16:37
    Worklog Time Spent: 10m 
      Work Description: maheshk114 commented on pull request #578: HIVE-21471: 
Replicating conversion of managed to external table leaks HDFS files at target.
URL: https://github.com/apache/hive/pull/578#discussion_r268132700
 
 

 ##########
 File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java
 ##########
 @@ -192,12 +197,12 @@ public void alterTable(RawStore msdb, Warehouse wh, 
String catName, String dbnam
       // 2) the table is not an external table, and
       // 3) the user didn't change the default location (or new location is 
empty), and
       // 4) the table was not initially created with a specified location
-      if (rename
-          && !oldt.getTableType().equals(TableType.VIRTUAL_VIEW.toString())
-          && (oldt.getSd().getLocation().compareTo(newt.getSd().getLocation()) 
== 0
-            || StringUtils.isEmpty(newt.getSd().getLocation()))
-          && !MetaStoreUtils.isExternalTable(oldt)) {
-        Database olddb = msdb.getDatabase(catName, dbname);
+      if (replDataLocationChanged
+              || (rename
 
 Review comment:
   i think in case of non txn table ..if the location is changed then rename 
..if its txn table  then delete the directory in replication flow. For normal 
flow, txn table, control  should not come till here ... it should fail in hive 
server it self 
 
----------------------------------------------------------------
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: 217329)

> Replicating conversion of managed to external table leaks HDFS files at 
> target.
> -------------------------------------------------------------------------------
>
>                 Key: HIVE-21471
>                 URL: https://issues.apache.org/jira/browse/HIVE-21471
>             Project: Hive
>          Issue Type: Bug
>          Components: repl
>    Affects Versions: 4.0.0
>            Reporter: Sankar Hariappan
>            Assignee: Sankar Hariappan
>            Priority: Major
>              Labels: DR, pull-request-available, replication
>         Attachments: HIVE-21471.01.patch, HIVE-21471.02.patch
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> While replicating the ALTER event to convert managed table to external table, 
> the data location for the table is changed under input base directory for 
> external tables replication. But, the old location remains there and would be 
> leaked for ever.
> ALTER TABLE T1 SET TBLPROPERTIES('EXTERNAL'='true');



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to