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

Enis Soztutar commented on HBASE-12943:
---------------------------------------

1. We can use serverName.getHostname() and getPort() here (and above)
{code}
+          Addressing.parseHostname(serverName.getHostAndPort()),
+          Addressing.parsePort(serverName.getHostAndPort()));
{code}
2. Maybe we can create a subtask for this since the jira is focussed on setting 
the TTL setting for Oracle JVM with some default setting, but your patch 
actually fixes another related problem with Connection caching per hostname. We 
need that patch first, then maybe setting the TTL setting from hbase-env.sh 
later. 

I think caching the stub key with the ip address is right since 
BlockingRpcChannelImplementation already constructs {{new 
InetSocketAddress()}}, and the connection from RpcClient will use the 
InetSocketAddress to talk. One thing we can consider is that, to be perfectly 
safe for changing either hostnames or ips, we can make the stub key cache like 
: {{ serviceName @ hostname / ip : port }}. InetAddress.toString() can be used 
for the middle part. 

> Set sun.net.inetaddr.ttl in HBase
> ---------------------------------
>
>                 Key: HBASE-12943
>                 URL: https://issues.apache.org/jira/browse/HBASE-12943
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Liu Shaohui
>            Assignee: Liu Shaohui
>             Fix For: 1.1.0
>
>         Attachments: 12943-1-master.txt
>
>
> The default value of config: sun.net.inetaddr.ttl is -1 and the java 
> processes will cache the mapping of hostname to ip address  forever, See: 
> http://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html
> But things go wrong when a regionserver with same hostname and different ip 
> address rejoins the hbase cluster. The HMaster will get wrong ip address of 
> the regionserver from this cache and every region assignment to this 
> regionserver will be blocked for a time because the HMaster can't communicate 
> with the regionserver.
> A tradeoff is to set the sun.net.inetaddr.ttl to 10m or 1h and make the wrong 
> cache expired.
> Suggestions are welcomed. Thanks~



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to