It would be nice to add that note to the doc.

And that leaves open the possibility that this feature may have a bug.

-- Jack Krupansky

From: DuyHai Doan 
Sent: Sunday, June 22, 2014 12:01 PM
To: user@cassandra.apache.org 
Subject: Re: Are writes to indexes performed asynchronously?

As far as I remember, 2i index consistency is ensured and repaired at read time 
to improve performance and avoid the dreadful read-before-write: 
http://www.datastax.com/dev/blog/improving-secondary-index-write-performance-in-1-2




On Sun, Jun 22, 2014 at 5:24 PM, Jack Krupansky <j...@basetechnology.com> wrote:

  The Cassandra 2.0 doc says that “Indexes are built in the background 
automatically, without blocking reads or writes.” IOW, no guarantee that the 2i 
will have been updated by the time you attempt a query on it. A GC or just 
general busyness of the node could delay the 2i update, even though it may 
generally complete quicker than you can do a query.

  See:
  http://www.datastax.com/documentation/cql/3.1/cql/ddl/ddl_build_index_c.html

  AFAICT, there is no mechanism for guaranteeing that a 2i has been updated.

  -- Jack Krupansky

  From: Tom van den Berge 
  Sent: Thursday, June 19, 2014 5:26 AM
  To: user@cassandra.apache.org 
  Subject: Are writes to indexes performed asynchronously?

  Hi,

  I have a column family with a secondary index on one of its columns. I 
noticed that when I write a row to the column family, and immediately query 
that row through the secondary index, every now and then it won't give any 
results.

  Could it be that Cassandra performs the write to the internal index column 
family asynchronously? That might explain this behaviour. 

  In other words, when writing to a indexed column family, is there, or can 
there be any guarantee that the write to index is completed when the write to 
the original column family is completed?

  I'm using a single-node cluster, with consistency level ONE.

  Thanks,
  Tom

Reply via email to