Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-8707 Implement an async pure c++ HDFS client
  3. HDFS-11908

libhdfs++: Authentication failure when first NN of kerberized HA cluster is standby

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • hdfs-client
    • None

    Description

      Library won't properly authenticate to kerberized HA cluster if the first namenode it tries to connect to is the standby. RpcConnection ends up attempting to use simple auth.

      Control flow to connect to NN for the first time:

      1. RpcConnection constructed with a pointer to the RpcEngine as the only argument
      2. RpcConnection::Connect(server endpoints, auth_info, callback called)
        • auth_info contains the SASL mechanism to use + the delegation token if we already have one

      Control flow to connect to NN after failover:

      1. RpcEngine::NewConnection called, allocates an RpcConnection exactly how step 1 above would
      2. RpcEngine::InitializeConnection called, sets event hooks and a string for cluster name
      3. Rpc calls sent using RpcConnection::PreEnqueueRequests called to add RPC message that didn't make it on last call due to standby exception
      4. RpcConnection::ConnectAndFlush called to send RPC packets. This only takes server endpoints, no auth info

      To fix:
      RpcEngine::InitializeConnection just needs to set RpcConnection::auth_info_ from the existing RpcEngine::auth_info_, even better would be setting this in the constructor so if an RpcConnection exists it can be expected to be in a usable state. I'll get a diff up once I sort out CI build failures.

      Also really need to get CI test coverage for HA and kerberos because this issue should not have been around for so long.

      Attachments

        1. HDFS-11908.HDFS-8707.000.patch
          3 kB
          James Clampffer

        Activity

          People

            James C James Clampffer
            James C James Clampffer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: