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

2ndary indexes can return stale data

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

            • Assignee:
              adelapena Andres de la Peña Assign to me
              Reporter:
              slebresne Sylvain Lebresne
              Authors:
              Andres de la Peña
              Reviewers:
              Benjamin Lerer, Caleb Rackliffe, Zhao Yang

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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

                  Issue deployment