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

CREATE INDEX can block for creation now that schema changes may be concurrent

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Low
    • Resolution: Unresolved
    • 4.x
    • Feature/2i Index
    • Low Hanging Fruit

    Description

      Response from CREATE INDEX command comes faster than the creation of secondary index. So below code:

      CREATE INDEX ON tab(name);
      SELECT * FROM tab WHERE name = 'Chris';
      

      doesn't return any rows(of course, in column family "tab", there are some records with "name" value = 'Chris'..) and any errors ( i would expect something like "Bad Request: No indexed columns present in by-columns clause with Equal operator")

      Inputing some timeout between those two commands resolves the problem, so:

      CREATE INDEX ON tab(name);
      Sleep(timeout); // for column family with 2000 rows the timeout had to be set for ~1 second 
      SELECT * FROM tab WHERE name = 'Chris';
      

      will return all rows with values as specified.

      I'm using single node cluster.

      Attachments

        Activity

          People

            Unassigned Unassigned
            krzysztof cieslinski Krzysztof Cieslinski Cognitum
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated: