[
https://issues.apache.org/jira/browse/HBASE-5088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13181164#comment-13181164
]
Lars Hofhansl commented on HBASE-5088:
--------------------------------------
Thanks!
Some performance hit was expected, as we didn't handle concurrency correctly
before.
But, wow 10% degradation, didn't expect ConcurrentSkipListMap to have such an
effect.
Hmm... Curious, since this is a client only change, did you happen to notice
higher (or lower) CPU usage on the client?
The current code is clearly not correct. Now I am wondering whether instances
of SoftValueSortedMap should be passed an optional "synchronizer object". By
default it would be "this", but for instances created from headMap, etc, it
would be the "synchronizer object" of the parent. Then instead of all methods
marked as synchronized they'd all synchronize on the "synchronizer object".
Do folks think this would be reasonable approach to validate?
I also would like to get opinions about doing away with SoftValueSortedMap and
using ConcurrentSkipListMap directly (~5% performance hit, and it would no
longer allow the JVM to remove the cached values under memory pressure - which
I think never works correctly anyway).
> A concurrency issue on SoftValueSortedMap
> -----------------------------------------
>
> Key: HBASE-5088
> URL: https://issues.apache.org/jira/browse/HBASE-5088
> Project: HBase
> Issue Type: Bug
> Components: client
> Affects Versions: 0.90.4, 0.94.0
> Reporter: Jieshan Bean
> Assignee: Jieshan Bean
> Priority: Critical
> Fix For: 0.92.0
>
> Attachments: 5088-useMapInterfaces.txt, 5088.generics.txt,
> HBase-5088-90.patch, HBase-5088-trunk.patch,
> HBase5088-90-replaceSoftValueSortedMap.patch,
> HBase5088-90-replaceTreeMap.patch, HBase5088-trunk-replaceTreeMap.patch,
> HBase5088Reproduce.java, PerformanceTestResults.png
>
>
> SoftValueSortedMap is backed by a TreeMap. All the methods in this class are
> synchronized. If we use this method to add/delete elements, it's ok.
> But in HConnectionManager#getCachedLocation, it use headMap to get a view
> from SoftValueSortedMap#internalMap. Once we operate
> on this view map(like add/delete) in other threads, a concurrency issue may
> occur.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira