You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "abel lin (JIRA)" <ji...@apache.org> on 2014/05/18 14:41:39 UTC

[jira] [Commented] (CASSANDRA-6506) counters++ split counter context shards into separate cells

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

abel lin commented on CASSANDRA-6506:
-------------------------------------

Hi all,

I am not sure if my question is proper here. But my question is about idempotent counters. 
After reading some threads about counters, I found the idea of replay id seems to solve the
problem of over-count. But I don't see more discussion about this. If we can use the replay id 
along with timestamp, the counter updated among replicas can be done well even if request again.
As for extra informations to save the replay id and timestamp, I think it's not a problem. 
We can preserve these for a period of time. The time can be reconfigured. 
These info can be deleted if over the preserved time.

I am concerned about the counter could be idempotent and how to deal with this in the future.

Much appreciated.

> counters++ split counter context shards into separate cells
> -----------------------------------------------------------
>
>                 Key: CASSANDRA-6506
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6506
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Aleksey Yeschenko
>            Assignee: Aleksey Yeschenko
>             Fix For: 3.0
>
>
> This change is related to, but somewhat orthogonal to CASSANDRA-6504.
> Currently all the shard tuples for a given counter cell are packed, in sorted order, in one binary blob. Thus reconciling N counter cells requires allocating a new byte buffer capable of holding the union of the two context's shards N-1 times.
> For writes, in post CASSANDRA-6504 world, it also means reading more data than we have to (the complete context, when all we need is the local node's global shard).
> Splitting the context into separate cells, one cell per shard, will help to improve this. We did a similar thing with super columns for CASSANDRA-3237. Incidentally, doing this split is now possible thanks to CASSANDRA-3237.
> Doing this would also simplify counter reconciliation logic. Getting rid of old contexts altogether can be done trivially with upgradesstables.
> In fact, we should be able to put the logical clock into the cell's timestamp, and use regular Cell-s and regular Cell reconcile() logic for the shards, especially once we get rid of the local/remote shards some time in the future (until then we still have to differentiate between global/remote/local shards and their priority rules).



--
This message was sent by Atlassian JIRA
(v6.2#6252)