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

Íñigo Goiri commented on HDFS-14435:
------------------------------------

The code looks a little convoluted.
What about something like:
{code}
  private HAServiceState getHAServiceState(NNProxyInfo<T> proxyInfo) {
    Exception e;
    try {
      return proxyInfo.proxy.getHAServiceState();
    } catch (RemoteException re) {
      // Though a Standby will allow a getHAServiceState call, it won't allow
      // delegation token lookup, so if DT is used it throws StandbyException
      IOException ioe = re.unwrapRemoteException(StandbyException.class);
      if (ioe instanceof StandbyException) {
        LOG.debug("NameNode {} threw StandbyException when fetching HAState",
            proxyInfo.getAddress());
        return HAServiceState.STANDBY;
      }
      e = re;
    } catch (IOException ioe) {
      e = ioe;
    }
    LOG.info("Failed to connect to {}. Assuming Standby state",
      proxyInfo.getAddress(), e);
    return HAServiceState.STANDBY;
  }
{code}

> ObserverReadProxyProvider is unable to properly fetch HAState from Standby NNs
> ------------------------------------------------------------------------------
>
>                 Key: HDFS-14435
>                 URL: https://issues.apache.org/jira/browse/HDFS-14435
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: ha, nn
>    Affects Versions: 3.3.0
>            Reporter: Erik Krogen
>            Assignee: Erik Krogen
>            Priority: Major
>         Attachments: HDFS-14435.000.patch, HDFS-14435.001.patch
>
>
> We have been seeing issues during testing of the Consistent Read from Standby 
> feature that indicate that ORPP is unable to call {{getHAServiceState}} on 
> Standby NNs, as they are rejected with a {{StandbyException}}. Upon further 
> investigation, we realized that although the Standby allows the 
> {{getHAServiceState()}} call, reading a delegation token is not allowed in 
> Standby state, thus the call will fail when using DT-based authentication. 
> This hasn't caused issues in practice, since ORPP assumes that the state is 
> Standby if it is unable to fetch the state, but we should fix the logic to 
> properly handle this scenario.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to