Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0397311C6C for ; Thu, 31 Jul 2014 04:54:39 +0000 (UTC) Received: (qmail 42470 invoked by uid 500); 31 Jul 2014 04:54:38 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 42166 invoked by uid 500); 31 Jul 2014 04:54:38 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 42153 invoked by uid 99); 31 Jul 2014 04:54:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Jul 2014 04:54:38 +0000 Date: Thu, 31 Jul 2014 04:54:38 +0000 (UTC) From: "Ted Yu (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-11623) mutateRowsWithLocks might require updatesLock.readLock with waitTime=0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-11623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14080492#comment-14080492 ] Ted Yu commented on HBASE-11623: -------------------------------- Sounds good. Do you want to attach a patch ? > mutateRowsWithLocks might require updatesLock.readLock with waitTime=0 > ---------------------------------------------------------------------- > > Key: HBASE-11623 > URL: https://issues.apache.org/jira/browse/HBASE-11623 > Project: HBase > Issue Type: Improvement > Components: regionserver > Affects Versions: 0.96.1.1, 0.94.21, 0.98.4 > Reporter: cuijianwei > Priority: Minor > > mutateRowsWithLocks will acquire updatesLock.readLock by the following code: > {code} > ... > lock(this.updatesLock.readLock(), acquiredRowLocks.size()); > ... > {code} > However, acquiredRowLocks might be empty, and then the waitTime of HRegion.lock(...) will be set to 0, which will make mutateRowsWithLocks fail if can not acquire updatesLock.readLock immediately. > In our environment, we implement a region coprocessor which need to hold row locks before invoke mutateRowsWithLocks. Then, the rowsToLock(passed to mutateRowsWithLocks) will be an empty set, and we get the following exception occasionally: > {code} > org.apache.hadoop.hbase.RegionTooBusyException: failed to get a lock in 0ms > 582 at org.apache.hadoop.hbase.regionserver.HRegion.lock(HRegion.java:6191) > 583 at org.apache.hadoop.hbase.regionserver.HRegion.mutateRowsWithLocks(HRegion.java:5126) > 584 at org.apache.hadoop.hbase.regionserver.HRegion.mutateRowsWithLocks(HRegion.java:5034) > ... > {code} > Is it reasonable that we use default waitTime when rowsToLock is empty? (as the following code) > {code} > lock(this.updatesLock.readLock(), acquiredRowLocks.size() == 0 ? 1 : acquiredRowLocks.size()); > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)