hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramkrishna S Vasudevan <ramakrish...@huawei.com>
Subject Problem in Caching the connection object in HBaseAdmin.getConnection()
Date Tue, 12 Jul 2011 12:06:22 GMT
Hi ,

 

I think there is  a bug in HBaseAdmin.getConnection(). 

 

The reason is 

In HConnectionManager the connection object is cached based on the
HConnectionKey. 

 

The equals method checks the value of the CONNECTION_PROPERTIES. 

 

Suppose if we do a restart/switch of the master and again try to do an
enable table operation then in the test code we will create a new HBaseAdmin
object. 

 

But the connection that the Admin creates to the Master is taken from the
cache though it is a new connection. 

 

Here none of the values in the CONNECTION_PROPERTIES is changed so we get
the same connection object, the one when the previous master was active and
hence though the master has been restarted we get the old active master
address and hence an exception is thrown. 

 

So in order to pass the test case we change the value of one of the
CONNECTION PROPERTIES so that the cached connection object is not returned. 

 

Correct me if am wrong?  

 

Am getting this problem when i try to run the test case of HBASE-4052 in
trunk.  This is one of the problems that I faced. Other one is that the
region server doesnt 

checkin after master switch has happened.

I overcame this by changing the value for one of the CONNECTION
PROPERTIES.(a workaround).

 

Regards

Ram

 

****************************************************************************
***********
This e-mail and attachments contain confidential information from HUAWEI,
which is intended only for the person or entity whose address is listed
above. Any use of the information contained herein in any way (including,
but not limited to, total or partial disclosure, reproduction, or
dissemination) by persons other than the intended recipient's) is
prohibited. If you receive this e-mail in error, please notify the sender by
phone or email immediately and delete it!

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message