[
https://issues.apache.org/jira/browse/HBASE-21021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16574546#comment-16574546
]
Nihal Jain edited comment on HBASE-21021 at 8/9/18 9:30 AM:
------------------------------------------------------------
{quote}The test on master branch fails too:
{code:java}
testAppendWithMultipleFamilies(org.apache.hadoop.hbase.regionserver.TestAtomicOperation)
Time elapsed: 2.859 sec <<< FAILURE!
java.lang.AssertionError: expected null, but was:<keyvalues=NONE>
at
org.apache.hadoop.hbase.regionserver.TestAtomicOperation.testAppendWithMultipleFamilies(TestAtomicOperation.java:166){code}
{quote}
The test failure is due to result not being null in case of master. In
branch-1, setting {{setReturnResults}} to {{false}} will return null, while in
master it returns an EMPTY_RESULT now, due to the following change
[HRegion.java#L7710|https://github.com/apache/hbase/blob/3f5033f88ee9da2a5a42d058b9aefe57b089b3e1/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java#L7710]
introduced in HBASE-16283.
The test passes on master after considering the change and asserting for
returned result {{isEmpty()}}. Hence, the ordering issue does not exist in
master.
Not sure whether the behavior change for {{setReturnResults}} is right. I think
it should still return null as the documentation also says that it may be null.
{code:java}
/**
* Appends values to one or more columns within a single row.
* <p>
* This operation guaranteed atomicity to readers. Appends are done
* under a single row lock, so write operations to a row are synchronized, and
* readers are guaranteed to see this operation fully completed.
*
* @param append object that specifies the columns and amounts to be used
* for the increment operations
* @throws IOException e
* @return values of columns after the append operation (maybe null)
*/
{code}
was (Author: nihaljain.cs):
{quote}The test on master branch fails too:
{code:java}
testAppendWithMultipleFamilies(org.apache.hadoop.hbase.regionserver.TestAtomicOperation)
Time elapsed: 2.859 sec <<< FAILURE!
java.lang.AssertionError: expected null, but was:<keyvalues=NONE>
at
org.apache.hadoop.hbase.regionserver.TestAtomicOperation.testAppendWithMultipleFamilies(TestAtomicOperation.java:166){code}
{quote}
The test failure is due to result not being null in case of master. In
branch-1, setting {{setReturnResults}} to {{false}} will return null, while in
master it returns an EMPTY_RESULT now, due to the following chnage
[HRegion.java#L7710|https://github.com/apache/hbase/blob/3f5033f88ee9da2a5a42d058b9aefe57b089b3e1/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java#L7710]
introduced in HBASE-16283.
The test passes on master after considering the change and asserting for not
{{isEmpty()}}.
The ordering issue does not exist in master.
> Result returned by Append operation should be ordered
> -----------------------------------------------------
>
> Key: HBASE-21021
> URL: https://issues.apache.org/jira/browse/HBASE-21021
> Project: HBase
> Issue Type: Bug
> Affects Versions: 1.3.0, 1.5.0
> Reporter: Nihal Jain
> Assignee: Nihal Jain
> Priority: Major
> Fix For: 1.5.0
>
> Attachments: HBASE-21021.branch-1.001.patch
>
>
> *Problem:*
> The result returned by the append operation should be ordered. Currently, it
> returns an unordered list, which may cause problems like if the user tries to
> perform Result.getValue(byte[] family, byte[] qualifier), even if the
> returned result has a value corresponding to (family, qualifier), the method
> may return null as it performs a binary search over the unsorted result
> (which should have been sorted actually).
>
> The result is enumerated by iterating over each entry of tempMemstore hashmap
> (which will never be ordered) and adding the values (see
> [HRegion.java#L7882|https://github.com/apache/hbase/blob/1b50fe53724aa62a242b74444f64adf7845048df/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java#L7882]).
>
> *Actual:* The returned result is unordered
> *Expected:* Similar to increment op, the returned result should be ordered.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)