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

Sam Tunnicliffe commented on CASSANDRA-20982:
---------------------------------------------

The complication obviously is that this changes the behaviour of some ALTER 
TABLE statements and while this behaviour change in itself may not be 
problematic for users the reasons [~brandon.williams] mentioned, from a TCM 
perspective it's a bit more involved. 
DDL statements are recorded as operations in the metadata log and may be 
replayed during node startup or when a peer falls behind and has to catch up. 
If the implementation changes so that a stmt is permitted in version X and 
denied in X+1, that would very likely cause problems. Once an operation is 
committed to the log, it must be executable by any node in the cluster. 
Committing this change to trunk now would only be an issue for operators 
running pre-release versions with TCM. Any upgrade from 5.0 (or earlier) to 
such a version would be fine.

If this change (or something similar) were to land in later version like 6.0.1, 
there are a couple of issues to negotiate:
 * An existing cluster running 6.0.0 may already have stmts committed to its 
log which will become un-replayable
 * During the 6.0.0 -> 6.0.1 upgrade the cluster is in a mixed state where some 
nodes will allow certain stmts which other nodes will not

That would probably require moving this specific validation around type 
compatibility out from {{AlterTable$AddColumns.apply}} and adding an element of 
version checking to it. 
Like I said, I don't think this is necessary to commit this to trunk now, but 
here's how it could be handled if something like this landed in a later 
version: 
[https://github.com/beobal/cassandra/commit/a01af6dc5607066a98cfdb69f5b00fcacf4bf548]

> BytesType should only be compatible with simple scalar types
> ------------------------------------------------------------
>
>                 Key: CASSANDRA-20982
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20982
>             Project: Apache Cassandra
>          Issue Type: Bug
>          Components: Cluster/Schema
>            Reporter: Brandon Williams
>            Assignee: MikoĊ‚aj
>            Priority: Normal
>             Fix For: 4.0.x, 4.1.x, 5.0.x, 5.x
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> Discovered while backporting CASSANDRA-18760, see 
> https://github.com/datastax/cassandra/commit/b5f7d239ce92db7d9c5f79c69cad0caea67fcb23
> Basically, things like 
> https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java#L71
>  shouldn't be allowed to pass, because converting a frozen collection to 
> bytes allows reading the raw bytes, which is nonsensical.
> This was found because the AbstractTypeTest is beefed up 
> [here|https://github.com/datastax/cassandra/blob/main/test/unit/org/apache/cassandra/db/marshal/AbstractTypeTest.java]



--
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