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

Namenode audit log to only include IP address of client

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      Fixes broken test: TestAuditLogger by restoring the behaviour for audit logs prior to HADOOP-18628

      With HADOOP-18628 in place, we perform InetAddress#getHostName in addition to InetAddress#getHostAddress, to save host name with IPC Connection object. When we perform InetAddress#getHostName, toString() of InetAddress would automatically print {hostName}/{hostIPAddress} if hostname is already resolved:

      /**
       * Converts this IP address to a {@code String}. The
       * string returned is of the form: hostname / literal IP
       * address.
       *
       * If the host name is unresolved, no reverse name service lookup
       * is performed. The hostname part will be represented by an empty string.
       *
       * @return  a string representation of this IP address.
       */
      public String toString() {
          String hostName = holder().getHostName();
          return ((hostName != null) ? hostName : "")
              + "/" + getHostAddress();
      }

       

      For namenode audit logs, this means that when dfs client makes filesystem updates, the audit logs would also print host name in the audit logs in addition to ip address.

      In order to maintain the compatibility, the purpose of this Jira is to only let audit log retrieve IP address from InetAddress and print it.

      Attachments

        Issue Links

          Activity

            People

              vjasani Viraj Jasani
              vjasani Viraj Jasani
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: