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

IndexOutOfBoundsException when accessing partition where the column was deleted

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete CommentsStop ReviewRequires TestingNeeds Committer
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Review In Progress
    • Normal
    • Resolution: Unresolved
    • 5.x
    • Legacy/CQL
    • None
    • Correctness - Transient Incorrect Response
    • Normal
    • Low Hanging Fruit
    • Fuzz Test
    • All
    • None
    • Hide

      new test

      Show
      new test

    Description

      Caused by: java.lang.IndexOutOfBoundsException
      	at java.base/java.nio.Buffer.checkIndex(Buffer.java:687)
      	at java.base/java.nio.HeapByteBuffer.get(HeapByteBuffer.java:169)
      	at org.apache.cassandra.db.marshal.ByteBufferAccessor.getByte(ByteBufferAccessor.java:184)
      	at org.apache.cassandra.db.marshal.ByteBufferAccessor.getByte(ByteBufferAccessor.java:42)
      	at org.apache.cassandra.db.marshal.ByteType.compareCustom(ByteType.java:51)
      	at org.apache.cassandra.db.marshal.AbstractType.compare(AbstractType.java:216)
      	at org.apache.cassandra.db.marshal.AbstractType.compare(AbstractType.java:211)
      	at org.apache.cassandra.db.marshal.AbstractType.compareForCQL(AbstractType.java:269)
      	at org.apache.cassandra.cql3.Operator$1.isSatisfiedBy(Operator.java:73)
      	at org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:725)
      	at org.apache.cassandra.db.filter.RowFilter$1.applyToPartition(RowFilter.java:227)
      	at org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:94)
      	at org.apache.cassandra.cql3.statements.SelectStatement.process(SelectStatement.java:1045)
      	at org.apache.cassandra.cql3.statements.SelectStatement.processResults(SelectStatement.java:629)
      	at org.apache.cassandra.cql3.statements.SelectStatement.executeInternal(SelectStatement.java:665)
      	at org.apache.cassandra.cql3.statements.SelectStatement.executeLocally(SelectStatement.java:635)
      	at org.apache.cassandra.cql3.statements.SelectStatement.executeLocally(SelectStatement.java:151)
      

      Table

      CREATE TABLE keyspace_test_00."3W56TBuMmC11vPVxalpse84eS" (
      		    pk0 date,
      		    pk1 double,
      		    ck0 int,
      		    ck1 inet,
      		    s0 tinyint static,
      		    v0 int,
      		    v1 varint,
      		    v2 varint,
      		    v3 timestamp,
      		    PRIMARY KEY ((pk0, pk1), ck0, ck1)
      		) WITH CLUSTERING ORDER BY (ck0 DESC, ck1 ASC)
      

      The query

      SELECT *
      FROM keyspace_test_00."3W56TBuMmC11vPVxalpse84eS"
      WHERE s0 = ? —- value is "(byte) -113"
      ALLOW FILTERING
      

      The issue is that we see the delete, but don’t properly handle null data

      ByteBuffer foundValue = getValue(metadata, partitionKey, row);
      // value is java.nio.HeapByteBuffer[pos=0 lim=0 cap=0]; aka null (empty)
      

      History of operations on this partition

      	History:
      		1: UPDATE pd0
      		2: Select Whole Partition pd0
      		4: Select Whole Partition pd0
      		6: Delete COLUMN [s0, v0, v1, v2, v3] pd0
      		7: Select Whole Partition pd0
      		10: Select Whole Partition pd0
      		12: Select Row pd0
      		17: Delete COLUMN [s0, v0, v1, v2, v3] pd0
      		20: INSERT pd0
      		27: UPDATE pd0
      		38: INSERT pd0
      		41: Select Row pd0
      		56: Select Row pd0
      		66: Delete COLUMN [s0, v0, v1, v2, v3] pd0
      		67: Search on column s0
      

      Here we see an insert was done so liveness info is generated, but we do delete on all columns leaving only the partition/clustering keys around...

      Attachments

        Activity

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

          People

            Novice_P Sunil Ramchandra Pawar Assign to me
            dcapwell David Capwell
            Sunil Ramchandra Pawar
            Caleb Rackliffe, David Capwell

            Dates

              Created:
              Updated:

              Slack

                Issue deployment