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

    • Type: Improvement
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Fix Version/s: 4.x
    • Component/s: Feature/2i Index
    • Labels:
    • Complexity:
      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

            • Assignee:
              kirktrue Kirk True
              Reporter:
              krzysztof cieslinski Krzysztof Cieslinski Cognitum
              Authors:
              Kirk True
            • Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated: