[ 
https://issues.apache.org/jira/browse/HIVE-10629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14549557#comment-14549557
 ] 

Eugene Koifman commented on HIVE-10629:
---------------------------------------

[~spena], [~Ferd], I got to the bottom of this.  The change in 
clearTestSideEffects() is problematic.
It causes QTestUtil.conf and HiveMetaStore.HMSHandler.hiveConf to be the same 
object.
(It's hard to explain the exact mechanics of how this happens in words, but you 
can easily see this in the debugger.  It's propagated through the session).
With shared config, whenever a .q file issues a "set some.hive.prop..." command 
it's applied to both client and code and metastore side.  Since .q file is 
meant to represent a CLI session - this is problematic and causes hard to find 
bugs.

Additionally, this change causes "set ..." commands from 1 .q file to leak into 
another which is also bad.


> Dropping table in an encrypted zone does not drop warehouse directory
> ---------------------------------------------------------------------
>
>                 Key: HIVE-10629
>                 URL: https://issues.apache.org/jira/browse/HIVE-10629
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Security
>    Affects Versions: 1.1.0
>            Reporter: Deepesh Khandelwal
>            Assignee: Eugene Koifman
>         Attachments: HIVE-10629.2.patch, HIVE-10629.3.patch, 
> HIVE-10629.4.patch, HIVE-10629.patch
>
>
> Drop table in an encrypted zone removes the table but not its data. The 
> client sees the following on Hive CLI:
> {noformat}
> hive> drop table testtbl;
> OK
> Time taken: 0.158 seconds
> {noformat}
> On the Hive Metastore log following error is thrown:
> {noformat}
> 2015-05-05 08:55:27,665 ERROR [pool-6-thread-142]: hive.log 
> (MetaStoreUtils.java:logAndThrowMetaException(1200)) - Got exception: 
> java.io.IOException Failed to move to trash: 
> hdfs://node-1.example.com:8020/apps/hive/warehouse/encdb1.db/testtbl
> java.io.IOException: Failed to move to trash: 
> hdfs://node-1.example.com:8020/apps/hive/warehouse/encdb1.db/testtbl
>         at 
> org.apache.hadoop.fs.TrashPolicyDefault.moveToTrash(TrashPolicyDefault.java:160)
>         at org.apache.hadoop.fs.Trash.moveToTrash(Trash.java:114)
>         at org.apache.hadoop.fs.Trash.moveToAppropriateTrash(Trash.java:95)
>         at 
> org.apache.hadoop.hive.shims.Hadoop23Shims.moveToAppropriateTrash(Hadoop23Shims.java:270)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStoreFsImpl.deleteDir(HiveMetaStoreFsImpl.java:47)
>         at 
> org.apache.hadoop.hive.metastore.Warehouse.deleteDir(Warehouse.java:229)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.deleteTableData(HiveMetaStore.java:1584)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.drop_table_core(HiveMetaStore.java:1552)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.drop_table_with_environment_context(HiveMetaStore.java:1705)
>         at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:107)
>         at com.sun.proxy.$Proxy13.drop_table_with_environment_context(Unknown 
> Source)
>         at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$drop_table_with_environment_context.getResult(ThriftHiveMetastore.java:9256)
>         ....
> {noformat}
> The client should throw the error and maybe fail the drop table call. To 
> delete the table data one currently has to use {{drop table testtbl purge}} 
> which basically remove the table data permanently skipping trash.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to