You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Aleksey Yeschenko (JIRA)" <ji...@apache.org> on 2017/01/27 22:22:24 UTC

[jira] [Comment Edited] (CASSANDRA-9425) Make node-local schema fully immutable

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

Aleksey Yeschenko edited comment on CASSANDRA-9425 at 1/27/17 10:22 PM:
------------------------------------------------------------------------

Committed as [af3fe39dcabd9ef77a00309ce6741268423206df|https://github.com/apache/cassandra/commit/af3fe39dcabd9ef77a00309ce6741268423206df] to trunk. Will open up a separate follow up ticket for DDL statement rework, as the comment section for this JIRA has grown quite a bit.

Thanks again for the review.


was (Author: iamaleksey):
Committed as [af3fe39dcabd9ef77a00309ce6741268423206df|] to trunk. Will open up a separate follow up ticket for DDL statement rework, as the comment section for this JIRA has grown quite a bit.

Thanks again for the review.

> Make node-local schema fully immutable
> --------------------------------------
>
>                 Key: CASSANDRA-9425
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9425
>             Project: Cassandra
>          Issue Type: Sub-task
>            Reporter: Aleksey Yeschenko
>            Assignee: Aleksey Yeschenko
>             Fix For: 4.0
>
>
> The way we handle schema changes currently is inherently racy.
> All of our {{SchemaAlteringStatement}} s perform validation on a schema state that's won't necessarily be there when the statement gets executed and mutates schema.
> We should make all the *Metadata classes ({{KeyspaceMetadata, TableMetadata}}, {{ColumnMetadata}}, immutable, and local schema persistently snapshottable, with a single top-level {{AtomicReference}} to the current snapshot. Have DDL statements perform validation and transformation on the same state.
> In pseudo-code, think
> {code}
> public interface DDLStatement
> {
>     /**
>      * Validates that the DDL statement can be applied to the provided schema snapshot.
>      *
>      * @param schema snapshot of schema before executing CREATE KEYSPACE
>      */
>     void validate(SchemaSnapshot schema);
>  
>     /**
>      * Applies the DDL statement to the provided schema snapshot.
>      * Implies that validate() has already been called on the provided snapshot.
>      *
>      * @param schema snapshot of schema before executing the statement
>      * @return snapshot of schema as it would be after executing the statement
>      */
>     SchemaSnapshot transform(SchemaSnapshot schema);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)