Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-6792

Allow user's full principal name as owner of MapReduce staging directory in JobSubmissionFiles#JobStagingDir()

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-alpha2
    • Component/s: client
    • Labels:
      None

      Description

      Background -
      Currently, JobSubmissionFiles#JobStagingDir() assumes that file owner returned as part of FileSystem#getFileStatus() is always user's short principal name, which is true for HDFS. But, some file systems which are HDFS compatible like Azure Data Lake Store (ADLS) and work in multi tenant environment can have users with same names belonging to different domains. For example, user1@company1.com and user1@company2.com. It will be ambiguous, if FileSystem#getFileStatus() returns only the user's short principal name (without domain name) as the owner of the file/directory.

      The following code block allows only short user principal name as owner. It simply fails saying that ownership on the staging directory is not as expected, if owner returned by the FileStatus#getOwner() is not equal to short principal name of the current user.

          String realUser;
          String currentUser;
          UserGroupInformation ugi = UserGroupInformation.getLoginUser();
          realUser = ugi.getShortUserName();
          currentUser = UserGroupInformation.getCurrentUser().getShortUserName();
          if (fs.exists(stagingArea)) {
            FileStatus fsStatus = fs.getFileStatus(stagingArea);
            String owner = fsStatus.getOwner();
            if (!(owner.equals(currentUser) || owner.equals(realUser))) {
               throw new IOException("The ownership on the staging directory " +
                            stagingArea + " is not as expected. " +
                            "It is owned by " + owner + ". The directory must " +
                            "be owned by the submitter " + currentUser + " or " +
                            "by " + realUser);
            }
      	  

      The proposal is to remove the strict restriction on short principal name by allowing the user's full principal name as owner of staging area directory in JobSubmissionFiles#JobStagingDir().

        Attachments

        1. MAPREDUCE-6792.1.patch
          3 kB
          Santhosh G Nayak
        2. MAPREDUCE-6792.2.patch
          10 kB
          Santhosh G Nayak
        3. MAPREDUCE-6792.3.patch
          11 kB
          Santhosh G Nayak

          Activity

            People

            • Assignee:
              snayak Santhosh G Nayak
              Reporter:
              snayak Santhosh G Nayak
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: