Cassandra
  1. Cassandra
  2. CASSANDRA-5030

IndexHelper.IndexFor call throws AOB exception when passing multiple slices

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Fix Version/s: 1.2.0 rc1
    • Component/s: Core
    • Labels:
      None

      Description

      While testing multiple slices I'm seeing some exceptions when a slice hits the end of an index.

      ERROR [ReadStage:138179] 2012-12-04 18:04:28,796 CassandraDaemon.java (line 132) Exception in thread Thread[ReadStage:138179,5,main]
      java.lang.IndexOutOfBoundsException: toIndex = 6
              at java.util.SubList.<init>(AbstractList.java:602)
              at java.util.RandomAccessSubList.<init>(AbstractList.java:758)
              at java.util.AbstractList.subList(AbstractList.java:468)
              at org.apache.cassandra.io.sstable.IndexHelper.indexFor(IndexHelper.java:182)
              at org.apache.cassandra.db.columniterator.IndexedSliceReader$IndexedBlockFetcher.setNextSlice(IndexedSliceReader.java:253)
              at org.apache.cassandra.db.columniterator.IndexedSliceReader$IndexedBlockFetcher.<init>(IndexedSliceReader.java:246)
              at org.apache.cassandra.db.columniterator.IndexedSliceReader.<init>(IndexedSliceReader.java:91)
              at org.apache.cassandra.db.columniterator.SSTableSliceIterator.createReader(SSTableSliceIterator.java:68)
              at org.apache.cassandra.db.columniterator.SSTableSliceIterator.<init>(SSTableSliceIterator.java:44)
              at org.apache.cassandra.db.filter.SliceQueryFilter.getSSTableColumnIterator(SliceQueryFilter.java:101)
              at org.apache.cassandra.db.filter.QueryFilter.getSSTableColumnIterator(QueryFilter.java:68)
              at org.apache.cassandra.db.CollationController.collectAllData(CollationController.java:267)
              at org.apache.cassandra.db.CollationController.getTopLevelColumns(CollationController.java:61)
              at org.apache.cassandra.db.ColumnFamilyStore.getTopLevelColumns(ColumnFamilyStore.java:1387)
              at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1247)
              at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1159)
              at org.apache.cassandra.db.Table.getRow(Table.java:348)
              at org.apache.cassandra.db.SliceFromReadCommand.getRow(SliceFromReadCommand.java:70)
              at org.apache.cassandra.db.ReadVerbHandler.doVerb(ReadVerbHandler.java:48)
              at org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:56)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:662)
      

      I can reproduce this in a test, attached

      1. 5030.txt
        4 kB
        T Jake Luciani
      2. 5030-1.txt
        4 kB
        T Jake Luciani

        Activity

        Hide
        T Jake Luciani added a comment -

        Committed

        Show
        T Jake Luciani added a comment - Committed
        Hide
        Jonathan Ellis added a comment -

        +1

        Show
        Jonathan Ellis added a comment - +1
        Hide
        T Jake Luciani added a comment -

        New version with recommended changes

        Show
        T Jake Luciani added a comment - New version with recommended changes
        Hide
        Jonathan Ellis added a comment -

        SSTableNamesIterator doesn't check for index < 0, which could be problematic.

        Nit: prefer static import for assertEquals.

        Show
        Jonathan Ellis added a comment - SSTableNamesIterator doesn't check for index < 0, which could be problematic. Nit: prefer static import for assertEquals.

          People

          • Assignee:
            T Jake Luciani
            Reporter:
            T Jake Luciani
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development