Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase, mail # user - NullPointerException while loading large amount of new rows into HBase, exception is thrown when trying to obtain lock for RowKey


Copy link to this message
-
Re: NullPointerException while loading large amount of new rows into HBase, exception is thrown when trying to obtain lock for RowKey
ramkrishna vasudevan 2013-05-17, 03:49
The lockRow and unlockRow have been replaced by checkAndXXX and increment()
apis so that any operation on a particular row can be done automically.
Am not sure of the use case that you are addressing here but i recommend
taking a look at these apis if they solve the problem for  you.

RowLocks are prone to more thread contentions and some deadlock situations
when there are lot of threads waiting for the same row lock.

Regards
Ram
On Fri, May 17, 2013 at 12:11 AM, Tianying Chang <[EMAIL PROTECTED]> wrote:

> FYI, below I quoted the customers' response after I explained the
> NULLException is caused by the row lock. So my question is if this is
> allowed situation for multiple threads/process to compete for the lock, the
> one who did not get should be considered normal and not throwing
> NullPointerException?
>
> Thanks
> Tian-Ying
>
> Quote from customer below:
> "Well yes, not only multiple threads, but multiple processes!
> That’s why we need a lock.
>
> Although I do see some practical problems, and am trying to NOT do the
> same lock from multiple threads within the same process, but it is needed
> to coordinate locks across processes"
>
> ________________________________________
> From: ramkrishna vasudevan [[EMAIL PROTECTED]]
> Sent: Thursday, May 16, 2013 10:16 AM
> To: [EMAIL PROTECTED]
> Subject: Re: NullPointerException while loading large amount of new rows
> into HBase, exception is thrown when trying to obtain lock for RowKey
>
> Which version of HBase?
>
> Regards
> Ram
>
>
> On Thu, May 16, 2013 at 10:42 PM, Tianying Chang <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
> >
> > When our customers(using TSDB) loads large amount of data into HBase, we
> > saw many NullPointerException in the RS logs as below. I checked the
> source
> > code, it seems when trying to obtain the lock for a rowKey, if the entry
> > for that row already exists and the "waitfoBlock" is false (therefore it
> > won't retry, but just return a NULL value). I can see in
> > doMiniBatchMutation(), the waitForBlock is set to be false. (most other
> > places "waitForBlock" is always set to true).
> >
> > This exception is thrown from function lockRow(), which has been
> > deprecated. I am not sure why it is deprecated, and what is used to
> replace
> > it. Is this normal? which implies the HBase should not throw this
> > misleading error message to log.  Or should the client call some other
> API?
> >
> > Thanks
> > Tian-Ying
> >
> > 2013-05-14 12:45:30,911 DEBUG
> > org.apache.hadoop.hbase.regionserver.HRegionServer: Row lock
> > -3430274391270203797 explicitly acquired by client
> > 2013-05-14 12:45:30,911 WARN org.apache.hadoop.ipc.HBaseServer:
> > (responseTooSlow): {"processingtimems":29783,"call":"lockRow([B@339a6a5c
> ,
> > [B@5ebcd87b), rpc version=1, client version=29,
> > methodsFingerPrint=0","client":"10.53.106.37:58892
> >
> ","starttimems":1368560701128,"queuetimems":847,"class":"HRegionServer","responsesize":0,"method":"lockRow"}
> > 2013-05-14 12:46:00,911 ERROR
> > org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row
> > lock (fsOk: true)
> > java.lang.NullPointerException
> >                 at
> > java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:881)
> >                 at
> >
> org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:2346)
> >                 at
> >
> org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:2332)
> >                 at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown
> > Source)
> >                 at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >                 at java.lang.reflect.Method.invoke(Method.java:597)
> >                 at
> >
> org.apache.hadoop.hbase.ipc.WritableRpcEngine$Server.call(WritableRpcEngine.java:384)
> >                 at
> >
> org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1336)
> > 2013-05-14 12:46:02,514 WARN org.apache.hadoop.ipc.HBaseServer: IPC