Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-11136 SASI index options validation
  3. CASSANDRA-11132

[SASI Pre-QA] Creating SPARSE index with literal type leaves the index in a stalled state

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 3.4
    • Legacy/CQL
    • None
    • Tested from build CASSANDRA-11067

    Description

      Tested from build CASSANDRA-11067

      CREATE KEYSPACE music WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;
      
      CREATE TABLE music.albums (
          id int PRIMARY KEY,
          artist text,
          title text
      );
      
      CREATE CUSTOM INDEX ON music.albums (title) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'SPARSE'};
      
      ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException:   java.lang.reflect.InvocationTargetException">
      
      

      The real exception message in /var/log/cassandra/system.log is : Caused by: java.lang.IllegalStateException: Unsupported mode: SPARSE.

      Worst, the index is created but not visible when calling DESCRIBE TABLE albums;. It is visible though in the system_keyspace.indexs table.

      Any further attempt to create a correct index on the same column fails:

      CREATE CUSTOM INDEX ON music.albums (title) USING 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = {'mode': 'PREFIX', 'analyzer_class': 'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', 'case_sensitive': 'false'};
      
      InvalidRequest: code=2200 [Invalid query] message="Index albums_title_idx already exists"
      
      

      We need to drop the invisible index before being able to create another index on the same column

      Attachments

        Activity

          People

            xedin Pavel Yaskevich
            doanduyhai DuyHai Doan
            Pavel Yaskevich
            Sam Tunnicliffe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: