hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Lipcon <t...@cloudera.com>
Subject Re: Why does HRegion acquire all needed locks before performing batch put?
Date Thu, 05 May 2011 18:23:32 GMT
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, 肖之慰 <zwxiao@gmail.com> 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
>



-- 
Todd Lipcon
Software Engineer, Cloudera

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message