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

Prepared statements using dropped indexes are not handled correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Won't Fix
    • 2.0.13
    • Legacy/CQL
    • None
    • Low

    Description

      When select statements are prepared, we verify that the column restrictions use indexes (where necessary). However, we don't perform a similar check when the statement is executed, so it fails somewhere further down the line. In this case, it hits an assertion:

      java.lang.AssertionError: Sequential scan with filters is not supported (if you just created an index, you need to wait for the creation to be propagated to all nodes before querying it)
      	at org.apache.cassandra.db.filter.ExtendedFilter$WithClauses.getExtraFilter(ExtendedFilter.java:259)
      	at org.apache.cassandra.db.ColumnFamilyStore.filter(ColumnFamilyStore.java:1759)
      	at org.apache.cassandra.db.ColumnFamilyStore.getRangeSlice(ColumnFamilyStore.java:1709)
      	at org.apache.cassandra.db.PagedRangeCommand.executeLocally(PagedRangeCommand.java:119)
      	at org.apache.cassandra.service.StorageProxy$LocalRangeSliceRunnable.runMayThrow(StorageProxy.java:1394)
      	at org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:1936)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:724)
      

      During execution, we should check that the indexes still exist and provide a better error if they do not.

      Attachments

        1. repro.py
          1 kB
          Tom Hobbs
        2. prepared_statements_test.py
          1 kB
          Stefania Alborghetti

        Activity

          People

            stefania Stefania Alborghetti
            thobbs Tom Hobbs
            Stefania Alborghetti
            Tom Hobbs
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: