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

Kelvin Kakugawa commented on CASSANDRA-1936:
--------------------------------------------

The refactor to store the partitioned counter in the value, instead, is a good 
direction.

I noticed some material changes, though:
- client deltas are in the correct partitioned counter format, but targeted at 
the local node
- the RowMutation : updateCommutativeTypes was removed

The code works, now, as long as the coordinator node (the local node) is part 
of the replica set.  However, if it's not, then all updates from those 
non-replica coordinators will be fixed at the highest delta.  The 
reconciliation strategy (on a replica) is sum my node's updates, but take the 
highest update from all other nodes.  (Just ran a distributed test to validate 
my hypothesis--the same test that's included on 1072.)

In the current code, value and partitioned counter are broken apart, because 
when the RowMutation is created we don't know which node we're going to write 
to, yet.  So, we can't create the final partitioned counter.  We could create a 
sentinel node that replicas need to look for, but that's dirty.  The way I 
solved it was using value for the client delta and converting it to the 
partitioned counter (w/ the target node) via RM : updateCommutativeTypes.

I have an alternate proposal for this ticket, the second patch on 1072.  I'll 
post it and we can take the best parts of each patch.

> Fit partitioned counter directly into CounterColumn.value 
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-1936
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1936
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Sylvain Lebresne
>            Assignee: Sylvain Lebresne
>             Fix For: 0.8
>
>         Attachments: 
> 0001-Put-partitioned-counter-directly-in-column-value.patch
>
>
> The current implementation of CounterColumn keeps both the partitioned
> counter and the total value of the counter (that is, the sum of the parts of
> the partitioned counter).
> This waste space and this requires the code to keep both representation in
> sync. This ticket propose to remove the total value from the representation
> and to only calculate it when returning the value to the client.
> NOTE: this breaks the on-disk file format (for counters)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to