Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AD0C12159 for ; Thu, 5 May 2011 18:24:20 +0000 (UTC) Received: (qmail 47025 invoked by uid 500); 5 May 2011 18:24:20 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 46993 invoked by uid 500); 5 May 2011 18:24:20 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 46984 invoked by uid 99); 5 May 2011 18:24:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 May 2011 18:24:20 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of todd@cloudera.com designates 209.85.214.41 as permitted sender) Received: from [209.85.214.41] (HELO mail-bw0-f41.google.com) (209.85.214.41) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 May 2011 18:24:14 +0000 Received: by bwz17 with SMTP id 17so3209270bwz.14 for ; Thu, 05 May 2011 11:23:52 -0700 (PDT) Received: by 10.205.24.12 with SMTP id rc12mr1610933bkb.199.1304619832338; Thu, 05 May 2011 11:23:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.205.81.143 with HTTP; Thu, 5 May 2011 11:23:32 -0700 (PDT) In-Reply-To: References: From: Todd Lipcon Date: Thu, 5 May 2011 11:23:32 -0700 Message-ID: Subject: Re: Why does HRegion acquire all needed locks before performing batch put? To: dev@hbase.apache.org Content-Type: multipart/alternative; boundary=20cf3036407dac68e104a28b79b7 --20cf3036407dac68e104a28b79b7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Wade, The goal of minibatches is to coalesce multiple puts into a single WAL edit= . Each WAL edit involves syncing the edit log, which is expensive. So, batching allows us to do fewer syncs. The reason that we stop a batch if we fail to lock a row is to avoid deadlocks. The code could probably be improved to try to lock as many as possible and then go back to try to lock any it missed in a second pass. Right now, it goes sequentially, I believe. -Todd On Thu, May 5, 2011 at 3:19 AM, =E8=82=96=E4=B9=8B=E6=85=B0 wrote: > hi all, > > When I read the doMiniBatchPut function in HBase-0.90.1, I find that > it would first acquire as many row locks as it can before performing > updates. If one row is not accessible, all following rows will not be > updated for this batch. So why not update one row at a time so that > every row can be processed? > > Thank you. > --- > Wade > --=20 Todd Lipcon Software Engineer, Cloudera --20cf3036407dac68e104a28b79b7--