[
https://issues.apache.org/jira/browse/CASSANDRA-12757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16547483#comment-16547483
]
Yuki Morishita commented on CASSANDRA-12757:
--------------------------------------------
Hi Damien,
Thanks for the patch.
My concern to your change is that it changes {{Keyspace.open}} method's
behavior. Right now it throws {{AssertionError}} stating that given keyspace
does not exist (if assertion is enabled which is default in Cassandra). It is
not perfect, but I prefer it stays the same than returning null resulting
{{NullPointerException}} without detail ({{Keyspace.open}} is used everywhere
without checking its returned value being null).
I think the original error happens if assertion is disabled. So, why don't we
check keyspace existence for this specific case?
> 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
> Assignee: Damien Stevenson
> 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: [email protected]
For additional commands, e-mail: [email protected]