cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nachiket Patil (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-12681) Reject empty options and invalid DC names in replication configuration while creating or altering a keyspace.
Date Mon, 26 Sep 2016 18:31:20 GMT

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

Nachiket Patil commented on CASSANDRA-12681:
--------------------------------------------

Thanks for the review and changes Jeff. Your changes look good, minor comment:

1. I would like to add a CREATE statement instead of ALTER statement in create tests for valid
+ invalid DC. We are testing same alter statement in alter tests.
CreateTest.java
#361
-       assertInvalidThrow(ConfigurationException.class, "ALTER KEYSPACE testABC WITH replication={
'class' : 'NetworkTopologyStrategy', '" + DATA_CENTER + "' : 2 , 'INVALID_DC': 1}");
+      assertInvalidThrow(ConfigurationException.class, "CREATE KEYSPACE testXYZ WITH replication={
'class' : 'NetworkTopologyStrategy', '" + DATA_CENTER + "' : 2 , 'INVALID_DC': 1}");

        // clean-up
        execute("DROP KEYSPACE testABC");
+     execute("DROP KEYSPACE testXYZ");

2. Just thought of quick enhancement: all drop keyspace statements in tests, add "IF EXISTS"
so if something goes wrong, the tests will fail with assertion failed error instead of "cannot
drop keyspace" ConfigurationException.

> Reject empty options and invalid DC names in replication configuration while creating
or altering a keyspace.
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-12681
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12681
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Distributed Metadata
>            Reporter: Nachiket Patil
>            Assignee: Nachiket Patil
>            Priority: Minor
>         Attachments: trunkpatch.diff, v3.0patch.diff
>
>
> Add some restrictions around create / alter keyspace with NetworkTopologyStrategy:
> 1. Do not accept empty replication configuration (no DC options after class). Cassandra
checks that SimpleStrategy must have replication_factor option but does not check that at
least one DC should be present in the options for NetworkTopologyStrategy.
> 2. Cassandra accepts any random string as DC name replication option for NetworkTopologyStrategy
while creating or altering keyspaces. Add a restriction that the options specified is valid
datacenter name. Using incorrect value or simple mistake in typing the DC name can cause outage
in production environment.



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

Mime
View raw message