Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-6359

KeyValue may return incorrect values after readFields()

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.94.2
    • None
    • None
    • Reviewed

    Description

      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:

      1. A KeyValue is created whose key has length 10. The private field keyLength is initialized to 0.
      2. KeyValue.getKeyLength() is called. This reads the key length 10 from the backing array and caches it in keyLength.
      3. 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.
      4. 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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dave_revell Dave Revell Assign to me
            dave_revell Dave Revell
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment