[ 
https://issues.apache.org/jira/browse/CASSANDRA-6477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14523507#comment-14523507
 ] 

Carl Yeksigian commented on CASSANDRA-6477:
-------------------------------------------

At NGCC, there was some discussion about how we are going to handle eventual 
consistency in this design.

Benedict's proposal earlier in this ticket, where each data replica performs a 
local read-before-write and pushes out the value to the index replicas is the 
one which does provide eventual consistency guarantees in line with user's 
expectations. In order to make sure that the values are consistent in the GI, 
it will also need to use a batch log at quorum to ensure that the update 
eventually gets applied.

Here is the process that GI will take on mutation:

- If the mutations will be affected by global indexes (either the target or an 
included column), coordinator creates batch log which will wait for a quorum to 
ack mutations before being deleted
- Coordinator pushes mutations out to data replicas
- Data replica checks if mutation touches global index
- Data replica takes lock on global index row in order to make sure that the 
generated mutations are consistent
- Data replica creates index mutation, blocks until that is complete
- Data replica applies data mutation, acks mutation

The ordering of the index mutation before the data mutation means that if we 
fail at index mutation, we will generate the same values the next time this 
mutations is applied.

We will send to exactly one replica, whose position in the ring relative to the 
token is equidistant as ours is.


> Global indexes
> --------------
>
>                 Key: CASSANDRA-6477
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6477
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Jonathan Ellis
>            Assignee: Carl Yeksigian
>              Labels: cql
>             Fix For: 3.x
>
>
> Local indexes are suitable for low-cardinality data, where spreading the 
> index across the cluster is a Good Thing.  However, for high-cardinality 
> data, local indexes require querying most nodes in the cluster even if only a 
> handful of rows is returned.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to