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

Yu Li updated HBASE-15451:
--------------------------
    Attachment: HBASE-15451.test

Attach a simple test, which records the synchronize times on readWaiters in 
MVCC and get the value in some UT cases. The result is as follows:

TestAtomicOperation#testAppendMultiThreads:
w/o patch: Synchronize times on readWaiters: 10000
w/ patch: Synchronize times on readWaiters: 0

TestHRegion#testWritesWhileScanning:
w/o patch Synchronize times on readWaiters: 981
w/ patch: Synchronize times on readWaiters: 0

which shows in most cases the contention is not that much to require sync on 
readWaiters 

> Remove unnecessary wait in MVCC
> -------------------------------
>
>                 Key: HBASE-15451
>                 URL: https://issues.apache.org/jira/browse/HBASE-15451
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 2.0.0, 1.2.0
>            Reporter: Yu Li
>            Assignee: Yu Li
>         Attachments: HBASE-15451.patch, HBASE-15451.test
>
>
> Currently the return value of MVCC#complete indicates whether readPoint 
> already advanced over write number of the given WriteEntry:
> {code}
> return readPoint.get() >= writeEntry.getWriteNumber();
> {code}
> While in MVCC#checkAndWait we never take usage of this but always call 
> waitForRead which will acquire and release lock on {{readWaiters}} and cause 
> additional context switch. This JIRA will improve this logic and remove the 
> unnecessary wait. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to