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

Hanisha Koneru commented on HADOOP-17116:
-----------------------------------------

[~ayushtkn], thanks for the UT. Helped me with the debug.



{{ObserverReadProxyProvider}} is using s \{{combinedProxy}} object which 
assigns \{{combinedInfo}} as the ProxyInfo.
{noformat}
ObserverReadProxyProvider# Lines 197-207:

for (int i = 0; i < nameNodeProxies.size(); i++) {
  if (i > 0) {
    combinedInfo.append(",");
  }
  combinedInfo.append(nameNodeProxies.get(i).proxyInfo);
}
combinedInfo.append(']');
T wrappedProxy = (T) Proxy.newProxyInstance(
    ObserverReadInvocationHandler.class.getClassLoader(),
    new Class<?>[] {xface}, new ObserverReadInvocationHandler());
combinedProxy = new ProxyInfo<>(wrappedProxy, combinedInfo.toString()){noformat}
RetryInvocationHandler depends on the ProxyInfo to differentiate between 
proxies while checking if failover from that proxy happened before.
{code:java}
failedAtLeastOnce.add(proxyDescriptor.getProxyInfo().toString());
{code}
And since combined proxy has only 1 proxy (or assigns the same ProxyInfo to all 
proxies), we see the multiple failover messages.

> Skip Retry INFO logging on first failover from a proxy
> ------------------------------------------------------
>
>                 Key: HADOOP-17116
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17116
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ha
>            Reporter: Hanisha Koneru
>            Assignee: Hanisha Koneru
>            Priority: Major
>         Attachments: HADOOP-17116.001.patch, HADOOP-17116.002.patch, 
> HADOOP-17116.003.patch
>
>
> RetryInvocationHandler logs an INFO level message on every failover except 
> the first. This used to be ideal before when there were only 2 proxies in the 
> FailoverProxyProvider. But if there are more than 2 proxies (as is possible 
> with 3 or more NNs in HA), then there could be more than one failover to find 
> the currently active proxy.
> To avoid creating noise in clients logs/ console, RetryInvocationHandler 
> should skip logging once for each proxy.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to