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

Ted Yu commented on HBASE-4087:
-------------------------------

First, waiting for reference count to reach zero wasn't part of the original 
semantics of obtaining connection.
Suppose there were two clients A and B. Client A is waiting in the new while 
loop for reference count to reach zero. What if client B had a bug and crashed ?

Patch version 2 directly removes the stale connection when the first client 
tried to connect to a dead server. Other clients wouldn't remove the new 
connection handed out to the first client. Since they share same config with 
the first client, they would retrieve the new connection directly.

Bookkeeping using connection#state would also work. But the above handling 
seems cleaner.

> HConnectionManager should perform validation of connection it hands out
> -----------------------------------------------------------------------
>
>                 Key: HBASE-4087
>                 URL: https://issues.apache.org/jira/browse/HBASE-4087
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Critical
>             Fix For: 0.92.0
>
>         Attachments: 4087-v2.txt, 4087.txt
>
>
> Through HBASE-3777, HConnectionManager reuses the connection to HBase servers.
> One challenge, discovered in troubleshooting HBASE-4052, is how we invalidate 
> connection(s) to server which gets restarted.
> There're at least two ways.
> 1. HConnectionManager utilizes background thread(s) to periodically perform 
> validation of connections in HBASE_INSTANCES and remove stale connection(s).
> 2. Allow HBaseClient (including HBaseAdmin) to provide feedback to 
> HConnectionManager.
> The solution can be a combination of both of the above.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to