1. Cassandra
  2. CASSANDRA-2897

Secondary indexes without read-before-write


    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: 1.2.0 beta 1
    • Component/s: None
    • Labels:


      Currently, secondary index updates require a read-before-write to maintain the index consistency. Keeping the index consistent at all time is not necessary however. We could let the (secondary) index get inconsistent on writes and repair those on reads. This would be easy because on reads, we make sure to request the indexed columns anyway, so we can just skip the row that are not needed and repair the index at the same time.

      This does trade work on writes for work on reads. However, read-before-write is sufficiently costly that it will likely be a win overall.

      There is (at least) two small technical difficulties here though:

      1. If we repair on read, this will be racy with writes, so we'll probably have to synchronize there.
      2. We probably shouldn't only rely on read to repair and we should also have a task to repair the index for things that are rarely read. It's unclear how to make that low impact though.
      1. 0001-CASSANDRA-2897-Secondary-indexes-without-read-before-w.txt
        36 kB
        Sam Tunnicliffe
      2. 41ec9fc-2897.txt
        35 kB
        Philip Jenvey
      3. 0002-CASSANDRA-2897-Secondary-indexes-without-read-before-w.txt
        53 kB
        Sam Tunnicliffe
      4. 2897-apply-cleanup.txt
        14 kB
        Jonathan Ellis
      5. 0003-CASSANDRA-2897.txt
        47 kB
        Sam Tunnicliffe
      6. 2897-v4.txt
        83 kB
        Jonathan Ellis

        Issue Links


          No work has yet been logged on this issue.


            • Assignee:
              Sam Tunnicliffe
              Sylvain Lebresne
              Jonathan Ellis
            • Votes:
              3 Vote for this issue
              14 Start watching this issue


              • Created: