hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ming Ma (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (HBASE-3793) HBASE-3468 Broke checkAndPut with null value
Date Sat, 11 Jun 2011 05:53:58 GMT

     [ https://issues.apache.org/jira/browse/HBASE-3793?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ming Ma reassigned HBASE-3793:
------------------------------

    Assignee: Ming Ma

I will follow up and add some unit test for this as well.

> HBASE-3468 Broke checkAndPut with null value
> --------------------------------------------
>
>                 Key: HBASE-3793
>                 URL: https://issues.apache.org/jira/browse/HBASE-3793
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.92.0
>            Reporter: Lars George
>            Assignee: Ming Ma
>            Priority: Blocker
>             Fix For: 0.92.0
>
>         Attachments: HBASE-3793.patch
>
>
> The previous code called Bytes.equal() which does a check for "null" on the left or right
argument. Now the comparator calls Bytes.compareTo() - which has no check for null. But this
is a valid input and checks for existence. I actually noticed this running 
> https://github.com/larsgeorge/hbase-book/blob/master/ch04/src/main/java/client/CheckAndPutExample.java
> This used to work, now it throws an NPE
> {noformat}
> Caused by: java.lang.NullPointerException
> 	at org.apache.hadoop.hbase.util.Bytes.compareTo(Bytes.java:854)
> 	at org.apache.hadoop.hbase.filter.WritableByteArrayComparable.compareTo(WritableByteArrayComparable.java:63)
> 	at org.apache.hadoop.hbase.regionserver.HRegion.checkAndMutate(HRegion.java:1681)
> 	at org.apache.hadoop.hbase.regionserver.HRegionServer.checkAndMutate(HRegionServer.java:1693)
> 	... 6 more
> 	at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getRegionServerWithRetries(HConnectionManager.java:1026)
> 	at org.apache.hadoop.hbase.client.HTable.checkAndPut(HTable.java:750)
> 	at client.CheckAndPutExample.main(CheckAndPutExample.java:33)
> {noformat}
> Easy fixable, just needs to handle the null value before even calling comparator.compareTo().

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message