[
https://issues.apache.org/jira/browse/HDFS-14116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16723220#comment-16723220
]
Chao Sun commented on HDFS-14116:
---------------------------------
[~shv]: If I understand correctly, the reason to add this in HDFS-12976 is that
we can call {{getHAServiceStatus}} by re-using the proxies created using the
proxy factory? Now the problem is that {{ObserverReadProxyProvider}} won't work
with any other protocols than {{ClientProtocol}}, which is the issue we
encountered when running NNThroughputBenmarck.
The current solution removes that restriction. If the protocol is
{{ClientProtocol}}, the behavior is exactly the same. If it is not, this will
create an extra {{ClientProtocol}} proxy to get the HA service state.
> ObserverReadProxyProvider should work with protocols other than ClientProtocol
> ------------------------------------------------------------------------------
>
> Key: HDFS-14116
> URL: https://issues.apache.org/jira/browse/HDFS-14116
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: hdfs-client
> Reporter: Chen Liang
> Assignee: Chao Sun
> Priority: Major
> Fix For: HDFS-12943
>
> Attachments: HDFS-14116-HDFS-12943.000.patch,
> HDFS-14116-HDFS-12943.001.patch, HDFS-14116-HDFS-12943.002.patch,
> HDFS-14116-HDFS-12943.003.patch, HDFS-14116-HDFS-12943.004.patch
>
>
> Currently in {{ObserverReadProxyProvider}} constructor there is this line
> {code}
> ((ClientHAProxyFactory<T>) factory).setAlignmentContext(alignmentContext);
> {code}
> This could potentially cause failure, because it is possible that factory can
> not be casted here. Specifically,
> {{NameNodeProxiesClient.createFailoverProxyProvider}} is where the
> constructor will be called, and there are two paths that could call into this:
> (1).{{NameNodeProxies.createProxy}}
> (2).{{NameNodeProxiesClient.createFailoverProxyProvider}}
> (2) works fine because it always uses {{ClientHAProxyFactory}} but (1) uses
> {{NameNodeHAProxyFactory}} which can not be casted to
> {{ClientHAProxyFactory}}, this happens when, for example, running
> NNThroughputBenmarck. To fix this we can at least:
> 1. introduce setAlignmentContext to HAProxyFactory which is the parent of
> both ClientHAProxyFactory and NameNodeHAProxyFactory OR
> 2. only setAlignmentContext when it is ClientHAProxyFactory by, say, having a
> if check with reflection.
> Depending on whether it make sense to have alignment context for the case (1)
> calling code paths.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]