[
https://issues.apache.org/jira/browse/CASSANDRA-14405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16468072#comment-16468072
]
Blake Eggleston commented on CASSANDRA-14405:
---------------------------------------------
Initial refactor is here:
[https://github.com/bdeggleston/cassandra/tree/14405-replicas]. All utests and
dtests are passing.
The main change is the introduction of the Replica class. When a replication
strategy is asked for the replicas for a given token, instead of returning a
collection of endpoint addresses, it returns a collection of Replica objects.
In addition to the endpoint information, the replica object also contains the
transient/full status, and the token range it’s a replica for. Most
AbstractReplicationStrategy methods that returned InetAddressAndPort or
Range<Token> objects, as well as the methods that depend on them, now return
Replica objects.
I also added a collection like Replicas class, to be used in lieu of
Collection<Replica>. During the refactor, almost all bugs were due to calls to
contains/remove no longer totally making sense. Since the Replica class adds
additional information, calls to contains/remove become a bit ambiguous, since
you’re often interested in whether a collection of replicas contains a specific
endpoint or range, not a specific combination of endpoint/range/transient. So,
the Replicas class extends Iterable<Replica> and forces you to be explicit
about what exactly you’re interested in the collection containing, or removing
from it.
> Transient Replication: Metadata refactor
> ----------------------------------------
>
> Key: CASSANDRA-14405
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14405
> Project: Cassandra
> Issue Type: Sub-task
> Components: Core, Distributed Metadata, Documentation and Website
> Reporter: Ariel Weisberg
> Assignee: Blake Eggleston
> Priority: Major
> Fix For: 4.0
>
>
> Add support to CQL and NTS for configuring keyspaces to have transient
> replicas.
> Add syntax allowing a keyspace using NTS to declare some replicas in each DC
> as transient.
> Implement metadata internal to the DB so that it's possible to identify what
> replicas are transient for a given token or range.
> Introduce Replica which is an InetAddressAndPort and a boolean indicating
> whether the replica is transient. ReplicatedRange which is a wrapper around a
> Range that indicates if the range is transient.
> Block altering of keyspaces to use transient replication if they already
> contain MVs or 2i.
> Block the creation of MV or 2i in keyspaces using transient replication.
> Block the creation/alteration of keyspaces using transient replication if the
> experimental flag is not set.
> Update web site, CQL spec, and any other documentation for the new syntax.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]