cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Thornton (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-8119) More Expressive Consistency Levels
Date Tue, 11 Aug 2015 18:18:47 GMT


Sean Thornton commented on CASSANDRA-8119:

I'm torn on this one - while I agree there is a desire for more flexibility, I also think
it has the potential to add an equal amount of complexity.  And this is from someone who has
a number of people asking for this feature.  

Adding additional, specific CLs is complicated because it's a slippery slope.  One person
wants LOCAL_QUORM + 1 in an outside DC.  One wants LOCAL_QUORUM in N DCs.  One wants 1 in
every DC.  It keeps going and I don't think anyone wants 50 enums in the class.  Adding an
enum of CUSTOM puts a lot of complexity on the client and feels like we're punting.  The client
now has to know 1) what datacenter he is in (and this is ignoring the coordinator so lets
hope they're the same) and 2) the layout of the entire cluster (or at least the keyspace replication
I guess).  I also have no idea how a downgrading consistency retry policy would work with
either of these.

If I had to do this, I would probably lean towards switching ConsistencyLevelS to a strategy,
similar to the compaction or replication strategies.  The ConsistencyLevel enum would need
to switch to an interface which others could extend, implement, and supply in their Cassandra
install like other custom classes.  This has the problem of also being pretty complex so I'm
on the fence.

> More Expressive Consistency Levels
> ----------------------------------
>                 Key: CASSANDRA-8119
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Tyler Hobbs
> For some multi-datacenter environments, the current set of consistency levels are too
restrictive.  For example, the following consistency requirements cannot be expressed:
> * LOCAL_QUORUM in two specific DCs
> * LOCAL_QUORUM in the local DC plus LOCAL_QUORUM in at least one other DC
> * LOCAL_QUORUM in the local DC plus N remote replicas in any DC
> I propose that we add a new consistency level: CUSTOM.  In the v4 (or v5) protocol, this
would be accompanied by an additional map argument.  A map of {DC: CL} or a map of {DC: int}
is sufficient to cover the first example.  If we accept a special keys to represent "any datacenter",
the second case can be handled.  A similar technique could be used for "any other nodes".
> I'm not in love with the special keys, so if anybody has ideas for something more elegant,
feel free to propose them.  The main idea is that we want to be flexible enough to cover any
reasonable consistency or durability requirements.

This message was sent by Atlassian JIRA

View raw message