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

Thejas M Nair commented on HIVE-5486:
-------------------------------------

But this section in old code in HiveSessionImplwithUGI.java was changing the 
scratch dir from "/tmp/scratchdir" to "/tmp/scratchdir-username" . So the first 
user (say user1) should create dir "/tmp/scratchdir-user1" , and a different 
user2 should create "/tmp/scratchdir-user2" . Are you saying that logic wasn't 
working ?

{code}
141     
  // Append the user name to temp/scratch directory path for each impersonated 
user
142     
  private void setUserPath(String userName) {
143     
    for (HiveConf.ConfVars var: HiveConf.userVars) {
144     
      String userVar = getHiveConf().getVar(var);
145     
      if (userVar != null) {
146     
        // If there's a path separator at end then remove it
147     
        if (userVar.endsWith(File.separator)) {
148     
          userVar = userVar.substring(0, userVar.length()-2);
149     
        }
150     
        getHiveConf().setVar(var, userVar + "-" + userName);
151     
      }
152     
    }
153     
  }
{code}


> HiveServer2 should create base scratch directories at startup
> -------------------------------------------------------------
>
>                 Key: HIVE-5486
>                 URL: https://issues.apache.org/jira/browse/HIVE-5486
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>    Affects Versions: 0.11.0, 0.12.0
>            Reporter: Prasad Mujumdar
>            Assignee: Prasad Mujumdar
>         Attachments: HIVE-5486.2.patch, HIVE-5486.3.patch
>
>
> With impersonation enabled, the same base directory  is used by all 
> sessions/queries. For a new deployment, this directory gets created on first 
> invocation by the user running that session. This would cause directory 
> permission conflict for other users.
> HiveServer2 should create the base scratch dirs if it doesn't exist.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to