Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10417

Improve error message from checkBlockLocalPathAccess

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.2
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: datanode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The exception msg thrown by checkBlockLocalPathAccess is very specific to the implementation detail. It's really hard for users to understand it unless she reads and understands the code.

      The code is shown as follows:

      org.apache.hadoop.hdfs.server.datanode.DataNode
        private void checkBlockLocalPathAccess() throws IOException {
          checkKerberosAuthMethod("getBlockLocalPathInfo()");
          String currentUser = UserGroupInformation.getCurrentUser().getShortUserName();
          if (!usersWithLocalPathAccess.contains(currentUser)) {
            throw new AccessControlException(
                "Can't continue with getBlockLocalPathInfo() "
                    + "authorization. The user " + currentUser
                    + " is not allowed to call getBlockLocalPathInfo");
          }    
        }
      

      (basically she needs to understand the code logic of getBlockLocalPathInfo)


      Note that usersWithLocalPathAccess is a private final purely coming from the configuration settings of dfs.block.local-path-access.user,

      org.apache.hadoop.hdfs.server.datanode.DataNode
      private final List<String> usersWithLocalPathAccess;
      ....
      this.usersWithLocalPathAccess = Arrays.asList(
          conf.getTrimmedStrings(DFSConfigKeys.DFS_BLOCK_LOCAL_PATH_ACCESS_USER_KEY));
      

      In other word, the checking fails simply because the current user is not specified in the configuration setting of dfs.block.local-path-access.user. The log message should be much more clearer to make it easy for users to take actions, as demonstrated in the attached patch.

      Thanks!

        Attachments

        1. HDFS-10417.000.patch
          0.9 kB
          Tianyin Xu
        2. HDFS-10417.001.patch
          2 kB
          Tianyin Xu
        3. HDFS-10417.002.patch
          2 kB
          Tianyin Xu

          Activity

            People

            • Assignee:
              tianyin Tianyin Xu
              Reporter:
              tianyin Tianyin Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: