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

Daniel Dai commented on HIVE-15137:
-----------------------------------

Here is the instruction to reproduce:
1. set the size of thread pool to 1 (hive.metastore.fshandler.threads=1)
2. start metastore
3. Start HiveCli with user1, run "ALTER TABLE table1 ADD PARTITION ..."
4. Start HiveCli with user2, run "ALTER TABLE table1 ADD PARTITION ..."

The owner of both partition directories are user1.

The cause of the issue is the FileSystem object from fs cache in 
Warehouse.mkdirs has the wrong uid. At the time when mkdirs getting FileSystem, 
UserGroupInformation.getCurrentUser() in both cases is user1.

Upload a patch which use doAs inside thread within threadpool.

It is hard to write a UT. Manually tested.

> metastore add partitions background thread should use current username
> ----------------------------------------------------------------------
>
>                 Key: HIVE-15137
>                 URL: https://issues.apache.org/jira/browse/HIVE-15137
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 2.2.0, 2.1.1
>            Reporter: Thejas M Nair
>            Assignee: Daniel Dai
>
> The background thread used in HIVE-13901 for adding partitions needs to be 
> reinitialized with current UGI for each invocation. Otherwise the user in 
> context while thread was created would be the current UGI during the actions 
> in the thread.



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

Reply via email to