You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "stack (JIRA)" <ji...@apache.org> on 2010/09/03 06:55:32 UTC

[jira] Updated: (HBASE-2925) LRU of HConnectionManager.HBASE_INSTANCES breaks if HBaseConfiguration is changed

     [ https://issues.apache.org/jira/browse/HBASE-2925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HBASE-2925:
-------------------------

    Attachment: 2925.txt

Here's a start.  Its not done yet but shows direction: i.e. removing hashcode and equals from HBC.  TODO, is test that prove that HBASE-1251 is still fixed (I think thing to do here is just read configs down in TableServers out of the conf each time rather than once up front so if number of retries is changed mid-use, subsequent invocations will pick up new config. -- let me see).

{code}
Removes hashcode and equals from HBC.  Use Object hashcode instead
of try and have Configurations with same exact content somehow
equate.

M a/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java
  Removed hashCode and equals.
M a/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
M a/src/main/java/org/apache/hadoop/hbase/util/HMerge.java
M a/src/test/java/org/apache/hadoop/hbase/HBaseClusterTestCase.java
M a/src/test/java/org/apache/hadoop/hbase/util/DisabledTestMetaUtils.java
  Renamed deleteConnectionInfo as deleteConnection.
M a/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
  Fixed up some comments and javadoc.  Moved a few methods around.
  Use Configuration instance itself as key for TableServer instances
  rather than the Configuation hash code int.
  Renamed deleteConnectionInfo as deleteConnection.
M a/src/main/java/org/apache/hadoop/hbase/client/HTable.java
  Fixed up javadoc trying to explain implication of not passing
  Configuration constructing an HTable instance.
M a/src/main/java/org/apache/hadoop/hbase/client/HTableFactory.java
  White space removal.
M a/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java
  Added testNewConnectionsDoesNotOOME.  It calls slightly
  refactored Robert Mahfoud illustrative code.  Added assertions.
  Made it not run for ever.
{code}

> LRU of HConnectionManager.HBASE_INSTANCES breaks if HBaseConfiguration is changed
> ---------------------------------------------------------------------------------
>
>                 Key: HBASE-2925
>                 URL: https://issues.apache.org/jira/browse/HBASE-2925
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.20.3, 0.90.0
>            Reporter: Robert Mahfoud
>         Attachments: 2925.txt, SimpleHConnectionManagerLeakReplicator.java
>
>
> {{HConnectionManager.getConnection(config)}} caches the created {{TableServer}} in {{HBASE_INSTANCES}} (a {{LinkedHashMap}} ) which is keyed by the configuration instance itself.
> Given the current implementation of {{hashCode()}} (and {{equals()}}) of {{HBaseConfiguration}}, the hash code of the configuration is changed if any of its properties are changed, which will cause the keys of {{HBASE_INSTANCES}} to be inconsistent with the hashtable that contains them, making some entries unreachable.
> In this case, when the map's LRU strategy needs to remove the oldest entry, it tries to remove it based on the oldest key, which no longer gives the original hash code, therefore the lookup in {{HBASE_INSTANCES.remove(oldest)}} doesn't actually remove anything.
> This has been observed to lead to OOM errors in long running clients.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.