You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2020/09/05 03:53:00 UTC
[jira] [Resolved] (HBASE-6315) ipc.HBaseClient should support
address change as does hdfs
[ https://issues.apache.org/jira/browse/HBASE-6315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Duo Zhang resolved HBASE-6315.
------------------------------
Resolution: Not A Problem
HBase now uses a different rpc implementation comparing to hadoop.
> ipc.HBaseClient should support address change as does hdfs
> ----------------------------------------------------------
>
> Key: HBASE-6315
> URL: https://issues.apache.org/jira/browse/HBASE-6315
> Project: HBase
> Issue Type: Bug
> Components: IPC/RPC
> Affects Versions: 0.95.2
> Reporter: Nicolas Liochon
> Priority: Minor
>
> ipc.HBaseClient is a copy paste from ipc.Client. This implementation now support adress change.
> As a side node, HBase comment on 'the max number of retries is 45' is now wrong.
> --- HBaseClient
> } catch (SocketTimeoutException toe) {
> /* The max number of retries is 45,
> * which amounts to 20s*45 = 15 minutes retries.
> */
> handleConnectionFailure(timeoutFailures++, maxRetries, toe);
> } catch (IOException ie) {
> handleConnectionFailure(ioFailures++, maxRetries, ie);
> }
> --- Hadoop Client
> } catch (SocketTimeoutException toe) {
> /* Check for an address change and update the local reference.
> * Reset the failure counter if the address was changed
> */
> if (updateAddress()) {
> timeoutFailures = ioFailures = 0;
> }
> /* The max number of retries is 45,
> * which amounts to 20s*45 = 15 minutes retries.
> */
> handleConnectionFailure(timeoutFailures++, 45, toe);
> } catch (IOException ie) {
> if (updateAddress()) {
> timeoutFailures = ioFailures = 0;
> }
> handleConnectionFailure(ioFailures++, maxRetries, ie);
> }
> private synchronized boolean updateAddress() throws IOException {
> // Do a fresh lookup with the old host name.
> InetSocketAddress currentAddr = NetUtils.makeSocketAddr(
> server.getHostName(), server.getPort());
> if (!server.equals(currentAddr)) {
> LOG.warn("Address change detected. Old: " + server.toString() +
> " New: " + currentAddr.toString());
> server = currentAddr;
> return true;
> }
> return false;
> }
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)