You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Todd Lipcon (JIRA)" <ji...@apache.org> on 2010/05/20 18:29:17 UTC

[jira] Commented: (HBASE-2584) Add support for tryLock - non-blocking row lock acquisition

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

Todd Lipcon commented on HBASE-2584:
------------------------------------

Hi Michael. I think, if we maintain user-visible locks, this is a good idea. But I'm not convinced that we want to retain locks as a feature at all. Have you seen the discussion at HBASE-2332? Would be interested in your opinion there.

> Add support for tryLock - non-blocking row lock acquisition
> -----------------------------------------------------------
>
>                 Key: HBASE-2584
>                 URL: https://issues.apache.org/jira/browse/HBASE-2584
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: regionserver
>            Reporter: Michael Dalton
>             Fix For: 0.21.0
>
>         Attachments: 2584.patch
>
>
> Currently HBase clients can only acquire row locks via the blocking lockRow() method in HTable. As ryan described on the mailing list, relying on this method in rare highly contended situations can lead to (temporary) deadlock. This deadlock occurs if a client acquires the lock, and a large number of other clients attempt to acquire the lock and block. Each blocked client awaiting lock acquisition consumes one of the limited I/O handler threads on the regionserver. When lock holder wishes to release the lock, he will be unable to as all I/O threads are currently serving clients that are blocking on lock acquisition -- and thus no I/O threads are open to process the unlock request.
> To avoid deadlock situations such as the one described above, I have added support for 'tryLock' in HTable (and on the regionservers). The 'tryLock' method will attempt to acquire a row lock. In the event that a lock is already held, tryLock immediately returns null rather than blocking and waiting for the lock to be acquire. Clients can then implement their own backoff/retry policy to re-acquire the lock, determine their own timeout values, etc based on their application performance characteristics rather than block on the regionserver and tie up precious I/O regionserver handler threads for an indefinite amount of time. 

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