[
https://issues.apache.org/jira/browse/HBASE-4052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13063842#comment-13063842
]
ramkrishna.s.vasudevan commented on HBASE-4052:
-----------------------------------------------
Hi Ted,
I got the reason why we get the following error while executing the test case
{noformat}
testForCheckingIfEnableAndDisableWorksFineAfterSwitch(org.apache.hadoop.hbase.master.TestMasterRestartAfterDisablingTable)
Time elapsed: 23.153 sec <<< ERROR!
java.lang.reflect.UndeclaredThrowableException
at $Proxy12.isMasterRunning(Unknown Source)
at
org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:553)
at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:101)
at
org.apache.hadoop.hbase.HBaseTestingUtility.getHBaseAdmin(HBaseTestingUtility.java:1162)
at org.apache.hadoop.hbase.master.TestMasterRestartAfterDisablingTab
{noformat}
I think this is also 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 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.
Workaround:
==========
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.
I reverted the HBASE-4003 and this test case passed with the above change.
Not sure of the reason why RS doesnot checkin.
> Enabling a table after master switch is not allowing table scan. Throws
> NotServingRegionException
> --------------------------------------------------------------------------------------------------
>
> Key: HBASE-4052
> URL: https://issues.apache.org/jira/browse/HBASE-4052
> Project: HBase
> Issue Type: Bug
> Affects Versions: 0.90.3
> Environment: Linux
> Reporter: ramkrishna.s.vasudevan
> Assignee: ramkrishna.s.vasudevan
> Fix For: 0.90.4
>
> Attachments: 4052.txt, Disabled.bmp, Disabling-1.bmp,
> Disabling-2.bmp, HBASE-4052-1-0.90_1.patch, HBASE-4052-1-_TestCode.patch,
> HBASE-4052-1-trunk_1.patch, HBASE-4052.patch,
> TestMasterRestartAfterDisablingTable.java
>
>
> Following is the scenario:
> Start RS and Active and standby masters
> Create table and insert data.
> Disable the table.
> Stop the active master and switch to the standby master.
> Now enable the table.
> Do a scan on the enabled table.
> NotServingRegionException is Thrown.
> But the same works well when we dont switch the master.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira