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

Alex Petrov commented on CASSANDRA-19009:
-----------------------------------------

{quote}So my understanding is that TCM is effectively the source of truth for 
schema. Could this be safely achieved by only storing fast path info in the tcm 
schema? 
{quote}
The problem is that the requirement for TCM was to have full backwards 
compatibility, so we still do apply schema mutations to the system_schema 
keyspaces. Another problem is that by the time we are loading system_schema, 
TCM is not yet initialised.
 
That said, I have thought about it more and I think this all will not be a 
problem at all, and you can leave all of this mostly as-is. When you modify the 
{{system_schema}} keyspace, you propagate the change to schema tables via 
{{initializeKeyspaceInstances}} which builds a {{Keyspaces.diff}} and then 
calls {{SchemaKeyspace.convertSchemaDiffToMutations}}. 

Now, you can only replay the transformation to make this schema change if you 
already have the {{fast_path}} field in your local system table. So all we need 
to do is to add {{fast_path}} to make sure we pick it up via {{Keyspaces.diff}} 
for which we only need to do is to addd {{fast_path}} to {{equals}} (even 
though adding to {{hashCode}}` is not strictly necessary, i’d still do it to 
avoid confusion in the future). Sorry for the confusion. Please feel free to 
add {{fast_path}} to {{equals}} and {{hashCode}} on commit to avoid one more RT.


I am mostly +1 on the patch, the only thing I do not understand fully is the 
intention for {{maintenance}} scheduled task. Thing is, we seem to update 
{{peers}} only through {{maybeUpdateFastPath}}, which already holds the latest 
status that could have been updated. I first thought that it could be related 
to Accord topology updates, but {{updatePeers}} from topology seems to only be 
used in tests.

Also two minor comments, both small enough to update on commit:
  * I think {{KeyspaceMetadata#toCqlString}} is missing 
{code}
+            if (params.fastPath != null)
+            {
+                builder.append("  AND fast_path = '")
+                       .append(params.fastPath.toString().toLowerCase())
+                      .append("'");
+            }
{code}
  * in {{AccordFastPath}} I would flip the order of conditional's results
{code}
-        return updateTimeMillis > current.updated + (status != Status.SHUTDOWN 
? updateDelayMillis : 0);
+        return updateTimeMillis > current.updated + (status == Status.SHUTDOWN 
? 0 : updateDelayMillis);
{code}

Thank you!


> CEP-15: (C*/Accord)  Schema based fast path reconfiguration
> -----------------------------------------------------------
>
>                 Key: CASSANDRA-19009
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19009
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Accord
>            Reporter: Blake Eggleston
>            Assignee: Blake Eggleston
>            Priority: Normal
>             Fix For: 5.0.x
>
>
> This adds availability aware accord fast path reconfiguration, as well as 
> user configurable fast path settings, which are set at the keyspace level and 
> (optionally) at the table level for increased granularity.
> The major parts are:
> *Add availability information to cluster metadata*
> Accord topology in C* is not stored in cluster metadata, but is meant to 
> calculated deterministically from cluster metadata state at a given epoch. 
> This adds the availability data, as well as the failure detector / gossip 
> listener and state change deduplication to CMS.
> *Move C* accord keys/topology from keyspace prefixes to tableid prefixes*
> To support per-table fast path settings, topologies and keys need to include 
> the table id. Since accord topologies could begin to consume a lot of memory 
> in clusters with a lot of nodes and tables, topology generation has been 
> updated to reuse previously allocated shards / shard parts where possible, 
> which will only increase heap sizes when things actually change.
> *Make fast path settings configurable via schema*
> There are 2.5 strategies: Simple, Parameterized, and InheritKeyspaceSettings. 
> Simple will use as many available nodes as possible for the fast path 
> electorate, this is the default for the keyspace fast path strategy. 
> Parameterized allows you to set a target size, and preferred datacenters for 
> the FP electorate. InheritKeyspace tells topology generation to just use the 
> keyspace fast path settings, and is the default for the table fast path 
> strategy.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to