hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yu Li (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-18085) Prevent parallel purge in ObjectPool
Date Sun, 21 May 2017 11:22:04 GMT

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

Yu Li commented on HBASE-18085:
-------------------------------

bq. It will succeed if the lock is available even if other threads are waiting.
I guess this is discussing the case that there're both timed and untimed tryLock, and some
threads waiting with timed tryLock, but the lock might be grabbed by the untimed tryLock when
lock released?

Here the purpose is to prevent parallel purge and no fairness required (it doesn't matter
which threads performs the purge), and there's no timed tryLock ongoing, agree?

> Prevent parallel purge in ObjectPool
> ------------------------------------
>
>                 Key: HBASE-18085
>                 URL: https://issues.apache.org/jira/browse/HBASE-18085
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Yu Li
>            Assignee: Yu Li
>         Attachments: e89l05465.st3.jstack, HBASE-18085.patch
>
>
> Parallel purge in ObjectPool is meaningless and will cause contention issue since {{ReferenceQueue#poll}}
has synchronization (source code shown below)
> {code}
>     public Reference<? extends T> poll() {
>         if (head == null)
>             return null;
>         synchronized (lock) {
>             return reallyPoll();
>         }
>     }
> {code}
> We observed threads blocking on the purge method while using offheap bucket cache, and
we could easily reproduce this by testing the 100% cache hit case in bucket cache with enough
reading threads.
> We propose to add a purgeLock and use tryLock to avoid parallel purge.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message