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

Sylvain Lebresne commented on CASSANDRA-2892:
---------------------------------------------

Sure. Applying a counter update on the first replica has two parts: we apply 
locally (we know we are on a replica at that point), we read back (in 
cm.makeReplicationMutation, not showed in that diff) and finally we use 
sendToHintedEndpoint to send what was read to the remaining replica. To avoid 
reapplying locally in sendToHintedEndpoint, we used to give it the 
'applyMutationLocally' flag to false.

Instead, this patch remove the local node from hintedEndpoints (since we just 
applied locally already) before calling sendToHintedEndpoint. We can then just 
check if hintedEndpoints is empty as a synonym of 'is it RF=1'.

> Don't "replicate_on_write" with RF=1
> ------------------------------------
>
>                 Key: CASSANDRA-2892
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2892
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 0.8.0
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>            Priority: Trivial
>              Labels: counters
>             Fix For: 0.8.4
>
>         Attachments: 2892.patch
>
>
> For counters with RF=1, we still do a read to replicate, even though there is 
> nothing to replicate it too.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to