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

Damien Stevenson commented on CASSANDRA-12757:
----------------------------------------------

I have tested this too and get the same behaviour that [~Gerrrr] has shared 
above.

However, I do not think that failing with an AssertionError is the most 
appropriate way to handle the case where an incorrect keyspace value is 
provided for the allocate_tokens_for_keyspace option. To that end, I have 
created a patch that aims better handle this situation.

Please review and let me know if you have any comments.

Patch:
|[trunk|https://github.com/apache/cassandra/compare/trunk...damien-instaclustr:12757-NPE-trunk]|[3.11|https://github.com/apache/cassandra/compare/cassandra-3.11...damien-instaclustr:12757-NPE-3.11]|[3.0|https://github.com/apache/cassandra/compare/cassandra-3.0...damien-instaclustr:12757-NPE-3.0]|[dtest|https://github.com/apache/cassandra-dtest/compare/master...damien-instaclustr:12757-npe-allocate-tokens-for-keyspace]|

CircleCI Unit test results:
|[trunk|https://circleci.com/gh/damien-instaclustr/cassandra/56]|[3.11|https://circleci.com/gh/damien-instaclustr/cassandra/51]|[3.0|https://circleci.com/gh/damien-instaclustr/cassandra/54]|

> NPE if allocate_tokens_for_keyspace is typo/doesn't exist.
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-12757
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12757
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Configuration
>            Reporter: Jeremiah Jordan
>            Priority: Major
>              Labels: lhf
>             Fix For: 3.0.x, 3.11.x
>
>
> If the keyspace specified in allocate_tokens_for_keyspace does not exist you 
> get an NPE.  Should probably have a better error here letting people know 
> what the issue was.
> {code}
> INFO  21:07:22,582  StorageService.java:1152 - JOINING: getting bootstrap 
> token
> Exception (java.lang.NullPointerException) encountered during startup: null
> ERROR 21:07:22,590  CassandraDaemon.java:709 - Exception encountered during 
> startup
> java.lang.NullPointerException: null
>        at 
> org.apache.cassandra.db.Keyspace.createReplicationStrategy(Keyspace.java:325) 
> ~[cassandra-all-3.0.8.jar:3.0.8]
>        at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:298) 
> ~[cassandra-all-3.0.8.jar:3.0.8]
>        at org.apache.cassandra.db.Keyspace.open(Keyspace.java:129) 
> ~[cassandra-all-3.0.8.jar:3.0.8]
>        at org.apache.cassandra.db.Keyspace.open(Keyspace.java:106) 
> ~[cassandra-all-3.0.8.jar:3.0.8]
>        at 
> org.apache.cassandra.dht.BootStrapper.allocateTokens(BootStrapper.java:201) 
> ~[cassandra-all-3.0.8.jar:3.0.8]
>        at 
> org.apache.cassandra.dht.BootStrapper.getBootstrapTokens(BootStrapper.java:173)
>  ~[cassandra-all-3.0.8:3.0.8]
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to