[jira] [Comment Edited] (CASSANDRA-13813) Don't let user drop (or generally break) tables in system_distributed

2017-10-10 Thread Aleksey Yeschenko (JIRA)

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

Aleksey Yeschenko edited comment on CASSANDRA-13813 at 10/10/17 1:15 PM:
-

[~slebresne] I can/will extend the patch with a new {{reloadlocalschema}} JMX 
call and a nodetool cmd when/if you warm up to it sufficiently (:

EDIT: Actually, never mind. I'll do it either way, in a separate JIRA, for 
cleanliness sake, and it's independently useful anyway. Will poke you on it 
once ready.


was (Author: iamaleksey):
[~slebresne] I can/will extend the patch with a new {{reloadlocalschema}} JMX 
call and a nodetool cmd when/if you warm up to it sufficiently (:

> Don't let user drop (or generally break) tables in system_distributed
> -
>
> Key: CASSANDRA-13813
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13813
> Project: Cassandra
>  Issue Type: Bug
>  Components: Distributed Metadata
>Reporter: Sylvain Lebresne
>Assignee: Aleksey Yeschenko
> Fix For: 3.0.x, 3.11.x
>
>
> There is not currently no particular restrictions on schema modifications to 
> tables of the {{system_distributed}} keyspace. This does mean you can drop 
> those tables, or even alter them in wrong ways like dropping or renaming 
> columns. All of which is guaranteed to break stuffs (that is, repair if you 
> mess up with on of it's table, or MVs if you mess up with 
> {{view_build_status}}).
> I'm pretty sure this was never intended and is an oversight of the condition 
> on {{ALTERABLE_SYSTEM_KEYSPACES}} in 
> [ClientState|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/ClientState.java#L397].
>  That condition is such that any keyspace not listed in 
> {{ALTERABLE_SYSTEM_KEYSPACES}} (which happens to be the case for 
> {{system_distributed}}) has no specific restrictions whatsoever, while given 
> the naming it's fair to assume the intention that exactly the opposite.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Comment Edited] (CASSANDRA-13813) Don't let user drop (or generally break) tables in system_distributed

2017-08-29 Thread Aleksey Yeschenko (JIRA)

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

Aleksey Yeschenko edited comment on CASSANDRA-13813 at 8/29/17 1:23 PM:


Not having {{system_distributed}} in {{ALTERABLE_SYSTEM_KEYSPACES}} is an 
oversight from the patch that added {{system_distributed}}.

Had it been added correctly, CASSANDRA-13812 would not be a problem - 
{{ClientState.preventSystemKSSchemaModification()}} would've forbidden those 
drops.

The constant is there to enumerate the keyspace whose tables cannot be 
modified, and that's the purpose it serves. It might not have the best possible 
name, though, or be ideally documented.

I'd start with adding {{system_distributed}} to {{ALTERABLE_SYSTEM_KEYSPACES}} 
- that would immediately fix CASSANDRA-13812 and this ticket. Then rename 
{{ALTERABLE_SYSTEM_KEYSPACES}} to something more descriptive (even 
{{PARTIALLY_ALTERABLE_SYSTEM_KEYSPACES}} would be a start. And document the 
intent.

EDIT: As Sylvain reminded me offline, we don't really need 
{{ALTERABLE_SYSTEM_KEYSPACES}} at all. The intended set of keyspaces in there 
is duplicated in {{Schema.REPLICATED_SYSTEM_KEYSPACE_NAMES}}, which is what we 
should be using instead - directly or via 
{{SchemaConstants.isReplicatedSystemKeyspace()}}.


was (Author: iamaleksey):
Not having {{system_distributed}} in {{ALTERABLE_SYSTEM_KEYSPACES}} is an 
oversight from the patch that added {{system_distributed}}.

Had it been added correctly, CASSANDRA-13812 would not be a problem - 
{{ClientState.preventSystemKSSchemaModification()}} would've forbidden those 
drops.

The constant is there to enumerate the keyspace whose tables cannot be 
modified, and that's the purpose it serves. It might not have the best possible 
name, though, or be ideally documented.

I'd start with adding {{system_distributed}} to {{ALTERABLE_SYSTEM_KEYSPACES}} 
- that would immediately fix CASSANDRA-13812 and this ticket. Then rename 
{{ALTERABLE_SYSTEM_KEYSPACES}} to something more descriptive (even 
{{PARTIALLY_ALTERABLE_SYSTEM_KEYSPACES}} would be a start. And document the 
intent.

> Don't let user drop (or generally break) tables in system_distributed
> -
>
> Key: CASSANDRA-13813
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13813
> Project: Cassandra
>  Issue Type: Bug
>Reporter: Sylvain Lebresne
>Assignee: Aleksey Yeschenko
> Fix For: 3.0.x, 3.11.x
>
>
> There is not currently no particular restrictions on schema modifications to 
> tables of the {{system_distributed}} keyspace. This does mean you can drop 
> those tables, or even alter them in wrong ways like dropping or renaming 
> columns. All of which is guaranteed to break stuffs (that is, repair if you 
> mess up with on of it's table, or MVs if you mess up with 
> {{view_build_status}}).
> I'm pretty sure this was never intended and is an oversight of the condition 
> on {{ALTERABLE_SYSTEM_KEYSPACES}} in 
> [ClientState|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/ClientState.java#L397].
>  That condition is such that any keyspace not listed in 
> {{ALTERABLE_SYSTEM_KEYSPACES}} (which happens to be the case for 
> {{system_distributed}}) has no specific restrictions whatsoever, while given 
> the naming it's fair to assume the intention that exactly the opposite.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org