[ 
https://issues.apache.org/jira/browse/HBASE-21545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16709411#comment-16709411
 ] 

Andrey Elenskiy commented on HBASE-21545:
-----------------------------------------

Got curious to learn and dig through the code. I believe I've found the issue 
for the bug.

In 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/querymatcher/NewVersionBehaviorTracker.java
 is should be:

{{   public boolean done() {}}
{{-    // lastCq* have been updated to this cell.}}
{{-    return !(columns == null || lastCqArray == null) && Bytes}}
{{-        .compareTo(lastCqArray, lastCqOffset, lastCqLength, 
columns[columnIndex], 0,}}
{{-            columns[columnIndex].length) > 0;}}
{{+    return columnIndex >= columns.length;}}
{{   }}}

The reason it fails is because lastCq gets updated to the current cell while 
columnIndex hasn't been advanced from the already included column. Here's an 
example:
Columns A, B and C are in the row.
Get request with columns A and C.

1. {{lastCq*}} gets updated to A
2. checkColumn gets called on A, A gets included, columnIndex is on A
3. {{lastCq*}} gets updated to B
4. checkColumn calls done(), done checks if B > A (columnIndex is on A) which 
returns true
5. we are done with request

> NEW_VERSION_BEHAVIOR breaks Get/Scan with specified columns
> -----------------------------------------------------------
>
>                 Key: HBASE-21545
>                 URL: https://issues.apache.org/jira/browse/HBASE-21545
>             Project: HBase
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 2.1.1
>         Environment: HBase 2.1.1
> Hadoop 2.8.4
> Java 8
>            Reporter: Andrey Elenskiy
>            Assignee: Sakthi
>            Priority: Major
>         Attachments: App.java, HBASE-21545.branch-2.1.0001.patch, 
> HBASE-21545.branch-2.1.0002.patch
>
>
> Setting NEW_VERSION_BEHAVIOR => 'true' on a column family causes only one 
> column to be returned when columns are specified in Scan or Get query. The 
> result is always one first column by sorted order. I've attached a code 
> snipped to reproduce the issue that can be converted into a test.
> I've also validated with hbase shell and gohbase client, so it's gotta be 
> server side issue.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to