Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5E133106C1 for ; Fri, 28 Feb 2014 19:04:11 +0000 (UTC) Received: (qmail 95524 invoked by uid 500); 28 Feb 2014 19:04:02 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 95430 invoked by uid 500); 28 Feb 2014 19:04:01 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 95423 invoked by uid 99); 28 Feb 2014 19:04:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Feb 2014 19:04:01 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of shailesh2088@gmail.com designates 209.85.213.42 as permitted sender) Received: from [209.85.213.42] (HELO mail-yh0-f42.google.com) (209.85.213.42) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Feb 2014 19:03:54 +0000 Received: by mail-yh0-f42.google.com with SMTP id a41so1213606yho.1 for ; Fri, 28 Feb 2014 11:03:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=svtkewev7G7RiLasqIT5uRtGnuhRtHkFEpm5wWZF1wM=; b=KqTHEzZu7MhaR/I4fKkI3ZWAQWOILKcECmbu0Urhw+ko/WET4tFQ8bSeXelq8+bP9z /9q1Cjr7Mx/TyBimFtiHOTeVYDo3gNp0yG90IMPtEmu/ZnBF1CX2HtpwNTktUPgr5j8s DdfVe9YOchJBHFjI/HIsscG4GtDxkFZGDI0cx3gUG/+AWUrlc7SDRsZQoWtmI+7XhDrc UKshpFHtCD0qScQgJLDzPJmdrsEnE9BM5yZVmm5C/6pKuPBgUbQQE7RaRhdiR4g8qqSC N2vdGHxUasg3hY7SIbjMrSmW4rF0aBrvc+I/NVrtPRHE6LG416ZjCDW7PZRlWNNq18oW ZV4g== MIME-Version: 1.0 X-Received: by 10.236.142.198 with SMTP id i46mr3809067yhj.66.1393614213063; Fri, 28 Feb 2014 11:03:33 -0800 (PST) Received: by 10.170.86.65 with HTTP; Fri, 28 Feb 2014 11:03:33 -0800 (PST) In-Reply-To: References: Date: Fri, 28 Feb 2014 11:03:33 -0800 Message-ID: Subject: Re: HBase Exception: org.apache.hadoop.hbase.UnknownRowLockException From: Shailesh Samudrala To: Ted Yu Cc: "common-user@hadoop.apache.org" Content-Type: multipart/alternative; boundary=20cf306849ed1fc51f04f37c18f5 X-Virus-Checked: Checked by ClamAV on apache.org --20cf306849ed1fc51f04f37c18f5 Content-Type: text/plain; charset=ISO-8859-1 Hi Ted, Thank you for the references. Unfortunately, the next planned environment upgrade is towards the 2nd half of this year. Also, the transactions I talked about in my earlier email have already been implemented & we are currently trying to eliminate possibilities for multiple processes performing transactions on the same HBase row. Do you have any inputs/suggestions around rowLocking or something that is implementable using my current HBase version? I really appreciate your help. On Fri, Feb 28, 2014 at 10:52 AM, Ted Yu wrote: > In newer releases, there are multiple mechanisms where your scenario can > be implemented. > > Please consider upgrading your deployment. > > Some references: > https://blogs.apache.org/hbase/entry/coprocessor_introduction > src/main/java/org/apache/hadoop/hbase/coprocessor/MultiRowMutationEndpoint.java > (0.94) > > > On Fri, Feb 28, 2014 at 10:44 AM, Shailesh Samudrala < > shailesh2088@gmail.com> wrote: > >> The version I'm using is 0.90.6. >> >> We are trying to implement rowLock & rowUnLock on a HBase table to >> support our multi-operation transactions on a JSON object(receive value >> from user -> read HBase row -> calculate new value based on received value >> and current value in HBase -> put new Value to HBase) >> >> We want the transaction to go through without any writes occurring in >> between from other processes which also access the table, therefore we are >> trying to implement this using RowLocks. >> >> >> >> >> >> On Thu, Feb 27, 2014 at 10:16 PM, Ted Yu wrote: >> >>> You're using 0.94, right ? >>> >>> RowLock has been dropped since 0.96.0 >>> >>> Can you tell us more about your use case ? >>> >>> >>> On Thu, Feb 27, 2014 at 9:56 PM, Shailesh Samudrala < >>> shailesh2088@gmail.com> wrote: >>> >>>> I'm running a sample code I wrote to test HBase lockRow() and >>>> unlockRow() methods. The sample code is below: >>>> >>>> HTable table = new HTable(config, "test"); >>>> RowLock rowLock = table.lockRow(Bytes.toBytes(row)); >>>> System.out.println("Obtained rowlock on " + row + "\nRowLock: " + rowLock); >>>> >>>> Put p = new Put(Bytes.toBytes(row)); >>>> p.add(Bytes.toBytes("colFamily"), Bytes.toBytes(colFamily), Bytes.toBytes(value)); >>>> table.put(p); >>>> System.out.println("put row"); >>>> table.unlockRow(rowLock); >>>> System.out.println("Unlocked row!"); >>>> >>>> >>>> When I execute my code, I get an UnknownRowLockException. The >>>> documentation says that this error is thrown when an unknown row lock is >>>> passed to the region servers. I'm not sure how this is happening & how to >>>> resolve it. >>>> >>>> The stack trace is below: >>>> >>>> Obtained rowlock on row2 >>>> RowLock: org.apache.hadoop.hbase.client.RowLock@15af33d6 >>>> put row >>>> Exception in thread "main" org.apache.hadoop.hbase.UnknownRowLockException: org.apache.hadoop.hbase.UnknownRowLockException: 5763272717012243790 >>>> at org.apache.hadoop.hbase.regionserver.HRegionServer.unlockRow(HRegionServer.java:2099) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>>> at java.lang.reflect.Method.invoke(Method.java:597) >>>> at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:604) >>>> at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1055) >>>> >>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) >>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) >>>> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) >>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) >>>> at org.apache.hadoop.hbase.RemoteExceptionHandler.decodeRemoteException(RemoteExceptionHandler.java:96) >>>> at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.translateException(HConnectionManager.java:1268) >>>> at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getRegionServerWithRetries(HConnectionManager.java:1014) >>>> at org.apache.hadoop.hbase.client.HTable.unlockRow(HTable.java:870) >>>> at HelloWorld.Hello.HelloWorld.main(HelloWorld.java:41) >>>> >>>> >>> >> > --20cf306849ed1fc51f04f37c18f5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Ted,

Thank you for the references. U= nfortunately, the next planned environment upgrade is towards the 2nd half = of this year. Also, the transactions I talked about in my earlier email hav= e already been implemented & we are currently trying to eliminate possi= bilities for multiple processes performing transactions on the same HBase r= ow.=A0

Do you have any inputs/suggestions around rowLocking or= something that is implementable using my current HBase version?
=
I really appreciate your help.=A0


On Fri, Feb 28, 2014 at 10:52 AM, Ted Yu= <yuzhihong@gmail.com> wrote:
In newer releases, there are multiple mechanisms where you= r scenario can be implemented.

Please consider upgrading= your deployment.

Some references:


On Fri, Fe= b 28, 2014 at 10:44 AM, Shailesh Samudrala <shailesh2088@gmail.com> wrote:
The version I'm using i= s=A0= 0.90.6.=A0

We are trying to implement rowLock & rowUnLock on a HBase= table to support our multi-operation transactions on a JSON object(receive= value from user -> read HBase row -> calculate new value based on re= ceived value and current value in HBase -> put new Value to HBase)=A0

We want the transaction to go through without any writes= occurring in between from other processes which also access the table, the= refore we are trying to implement this using RowLocks.=A0



=


On Thu, Feb 27, 2014 at 10:16 PM, Ted Yu <yuzhihong@gmail.com&= gt; wrote:
You're using 0.94,= right ?

RowLock has been dropped since 0.96.0
=
Can you tell us more about your use case ?
=


On Thu, Feb 27, 2014 at 9:56 PM, Shailesh Samudrala <<= a href=3D"mailto:shailesh2088@gmail.com" target=3D"_blank">shailesh2088@gma= il.com> wrote:
I'm running a sample code I wrote to test HBase=A0lockRow()=A0and= =A0unlockRow()=A0methods. The sample code is below:

=
HTable table =3D new =
HTable(config, "test");
RowLock rowLock =3D table.lockRow(Bytes.toBytes(row));
System.out.println("Obtained rowlock on " + row + "\nRowLock=
: " + rowLock);

Put p =3D new Put(Bytes.toBytes(row));
p.add(Bytes.toBytes("colFamily"), Bytes.toBytes(colFamily), Bytes=
.toBytes(value));
table.put(p);
System.out.println("put row");
table.unlockRow(rowLock);
System.out.println("Unlocked row!");

When I execute my code, I get an=A0UnknownRowLockExceptio= n. The documentation says that this error is thrown when an unknown = row lock is passed to the region servers. I'm not sure how this is happ= ening & how to resolve it.

The stack trace is below:

Obtained rowlock on r=
ow2
RowLock: org.apache.hadoop.hbase.client.RowLock@15af33d6
put row
Exception in thread "main" org.apache.hadoop.hbase.UnknownRowLock=
Exception: org.apache.hadoop.hbase.UnknownRowLockException: 576327271701224=
3790
    at org.apache.hadoop.hbase.regionserver.HRegionServer.unlockRow(HRegion=
Server.java:2099)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl=
.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce=
ssorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:604)
    at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java=
:1055)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method=
)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruc=
torAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegating=
ConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.apache.hadoop.hbase.RemoteExceptionHandler.decodeRemoteException=
(RemoteExceptionHandler.java:96)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImpleme=
ntation.translateException(HConnectionManager.java:1268)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImpleme=
ntation.getRegionServerWithRetries(HConnectionManager.java:1014)
    at org.apache.hadoop.hbase.client.HTable.unlockRow(HTable.java:870)
    at HelloWorld.Hello.HelloWorld.main(HelloWorld.java:41)




--20cf306849ed1fc51f04f37c18f5--