Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-9239

OHCProvider doesn't write ByteBuffers with non-zero position correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 2.2.0 beta 1
    • Component/s: None
    • Labels:
      None
    • Severity:
      Low

      Description

      In OHCProvider.DataOutputPlusAdapter.write(), we do the following:

      if (buffer.hasArray())
          out.write(buffer.array(), buffer.arrayOffset(), buffer.remaining());
      

      This doesn't behave correctly if the ByteBuffer has a non-zero position. Instead, we need to add buffer.position() to buffer.arrayOffset().

      At least against CASSANDRA-8099, this has the effect of writing incorrect row cache entries.

        Attachments

        1. use-buffer-position.txt
          0.8 kB
          Tom Hobbs

          Activity

            People

            • Assignee:
              thobbs Tom Hobbs
              Reporter:
              thobbs Tom Hobbs
              Authors:
              Tom Hobbs
              Reviewers:
              Robert Stupp
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: