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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.2.0 beta 1
    • None
    • None
    • 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

            thobbs Tom Hobbs
            thobbs Tom Hobbs
            Tom Hobbs
            Robert Stupp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: