[
https://issues.apache.org/jira/browse/HBASE-26856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17558469#comment-17558469
]
Pankaj Kumar commented on HBASE-26856:
--------------------------------------
Earlier OnheapDecodedCell was containing the underlying array of
valAndTagsBuffer as value array, which is being considered while adding to the
responseBlockSize
https://github.com/apache/hbase/blob/c0e7e98ec71e77a9bfccf8f59e0c7c59aa70c828/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java#L1328
While processing next action the if condition will be true
(responseBlockSize=124 & hbase.server.scanner.max.result.size=100)
https://github.com/apache/hbase/blob/c0e7e98ec71e77a9bfccf8f59e0c7c59aa70c828/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java#L724
So exception will be set.
After the PR changes, we are extracting the value array from valAndTagsBuffer
and setting the same in Cell. In TestMultiRespectsLimits#testBlockMultiLimits
PUT are done with empty values,
https://github.com/apache/hbase/blob/c0e7e98ec71e77a9bfccf8f59e0c7c59aa70c828/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMultiRespectsLimits.java#L156
So during multi get, Cell#getValueArray() will return empty array in
RSRpcServices#addSize() and responseBlockSize will be 0. While processing next
action exception won't be set which is causing UT failure.
> BufferedDataBlockEncoder.OnheapDecodedCell value can get corrupted
> ------------------------------------------------------------------
>
> Key: HBASE-26856
> URL: https://issues.apache.org/jira/browse/HBASE-26856
> Project: HBase
> Issue Type: Bug
> Reporter: Mohammad Arshad
> Assignee: Mohammad Arshad
> Priority: Major
> Fix For: 2.5.0, 3.0.0-alpha-3
>
>
> In our production cluster we observed the cell value is modified after
> successful scanner read. After analyzing we observed OnheapDecodedCell is not
> created properly.
> We create OnheapDecodedCell with complete valAndTagsBuffer underlying array.
> {code:java}
> return new OnheapDecodedCell(Bytes.copy(keyBuffer, 0, this.keyLength),
> currentKey.getRowLength(), currentKey.getFamilyOffset(),
> currentKey.getFamilyLength(),
> currentKey.getQualifierOffset(), currentKey.getQualifierLength(),
> currentKey.getTimestamp(), currentKey.getTypeByte(),
> valAndTagsBuffer.array(),
> valAndTagsBuffer.arrayOffset() + vOffset, this.valueLength,
> memstoreTS, tagsArray,
> tOffset, this.tagsLength);
> {code}
> Here we are passing valAndTagsBuffer.array() for value extraction.
> The underlying array will be modified if it is altered anywhere.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)