You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Zhihong Ted Yu (JIRA)" <ji...@apache.org> on 2012/08/03 02:09:03 UTC

[jira] [Commented] (HBASE-6359) KeyValue may return incorrect values after readFields()

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

Zhihong Ted Yu commented on HBASE-6359:
---------------------------------------

Patch looks good to me.
                
> KeyValue may return incorrect values after readFields()
> -------------------------------------------------------
>
>                 Key: HBASE-6359
>                 URL: https://issues.apache.org/jira/browse/HBASE-6359
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Dave Revell
>            Assignee: Dave Revell
>              Labels: noob
>         Attachments: HBASE-6359-trunk-v1.diff
>
>
> When the same KeyValue object is used multiple times for deserialization using readFields, some methods may return incorrect values. Here is a sequence of operations that will reproduce the problem:
>  # A KeyValue is created whose key has length 10. The private field keyLength is initialized to 0.
>  # KeyValue.getKeyLength() is called. This reads the key length 10 from the backing array and caches it in keyLength.
>  # KeyValue.readFields() is called to deserialize a new value. The keyLength field is not cleared and keeps its value of 10, even though this value is probably incorrect.
>  # If getKeyLength() is called, the value 10 will be returned.
> For example, in a reducer with Iterable<KeyValue>, all values after the first one from the iterable are likely to return incorrect values from getKeyLength().
> The solution is to clear all memoized values in KeyValue.readFields(). I'll write a patch for this soon.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira