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

2ndary indexes can return stale data

    XMLWordPrintableJSON

Details

    Description

      When replica return 2ndary index results, it's possible for a single replica to return a stale result and that result will be sent back to the user, potentially failing the CL contract.

      For instance, consider 3 replicas A, B and C, and the following situation:

      CREATE TABLE test (k int PRIMARY KEY, v text);
      CREATE INDEX ON test(v);
      INSERT INTO test(k, v) VALUES (0, 'foo');
      

      with every replica up to date. Now, suppose that the following queries are done at QUORUM:

      UPDATE test SET v = 'bar' WHERE k = 0;
      SELECT * FROM test WHERE v = 'foo';
      

      then, if A and B acknowledge the insert but C respond to the read before having applied the insert, then the now stale result will be returned (since C will return it and A or B will return nothing).

      A potential solution would be that when we read a tombstone in the index (and provided we make the index inherit the gcGrace of it's parent CF), instead of skipping that tombstone, we'd insert in the result a corresponding range tombstone.

      Attachments

        Issue Links

          Activity

            People

              adelapena Andres de la Peña
              slebresne Sylvain Lebresne
              Andres de la Peña
              Benjamin Lerer, Caleb Rackliffe, Zhao Yang
              Votes:
              1 Vote for this issue
              Watchers:
              18 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 7h
                  7h