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

Li Pi commented on HBASE-4430:
------------------------------

This new patch synchronizes things a bit at the SingleSizeCache level. I do 
leave the copy to Slab, along with reads, unsynchronized, so it should give a 
performance advantage over Todd's super simplified patch.

If anyone was wondering, the race that occurred with the last patch worked like 
this.

Steady State: Item A is cached.
Thread B: Starts to cache something, starts eviction of Item A, 
evictionlistener is called, but has not been completed it.
Thread A: begins to recache item A, notices an entry for A already.
Thread B: gets around to evicting the entry for A, as it finishes eviction, 
wakes all the sleeping threads up so they have a chance to recache.
Thread A: continues onwards, sleeps the thread, and waits for something to wake 
it up. But B has already finished, and called notifier.notifyAll();

End result: A ends up sleeping indefinitely. Nothing notifies it.

I got rid of the jumble in the end. This should make maintenance much easier.
                
> Disable TestSlabCache and TestSingleSizedCache temporarily to see if these 
> are cause of build box failure though all tests pass
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-4430
>                 URL: https://issues.apache.org/jira/browse/HBASE-4430
>             Project: HBase
>          Issue Type: Task
>          Components: test
>            Reporter: stack
>            Assignee: Li Pi
>             Fix For: 0.92.0
>
>         Attachments: HBase-4430.txt, TestSlabCache.trace
>
>


--
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

        

Reply via email to