[
https://issues.apache.org/jira/browse/CASSANDRA-10120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15183672#comment-15183672
]
Paulo Motta commented on CASSANDRA-10120:
-----------------------------------------
I just ran into a minor issue on a dtest that would be easily spottable if this
check was in place. For example, I go this ugly exception in order to find out
that {{num_tokens=256}} and {{initial_token=custom_token}} (facepalm):
{noformat}
ERROR [MemtableFlushWriter:1] 2016-03-07 17:41:14,342 CassandraDaemon.java:195
- Exception in thread Thread[MemtableFlushWriter:1,5,main]
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[na:1.8.0_66]
at java.util.ArrayList.get(ArrayList.java:429) ~[na:1.8.0_66]
at
org.apache.cassandra.dht.Splitter.splitOwnedRangesNoPartialRanges(Splitter.java:99)
~[main/:na]
at org.apache.cassandra.dht.Splitter.splitOwnedRanges(Splitter.java:65)
~[main/:na]
at
org.apache.cassandra.service.StorageService.getDiskBoundaries(StorageService.java:4751)
~[main/:na]
at
org.apache.cassandra.db.Memtable.createFlushRunnables(Memtable.java:273)
~[main/:na]
at org.apache.cassandra.db.Memtable.flushRunnables(Memtable.java:265)
~[main/:na]
at
org.apache.cassandra.db.ColumnFamilyStore$Flush.run(ColumnFamilyStore.java:1061)
~[main/:na]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
~[na:1.8.0_66]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
~[na:1.8.0_66]
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_66]
{noformat}
This is to say +1 to this check, which could have saved some minutes of my
life. :)
> When specifying both num_tokens and initial_token, error out if the numbers
> don't match
> ---------------------------------------------------------------------------------------
>
> Key: CASSANDRA-10120
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10120
> Project: Cassandra
> Issue Type: Improvement
> Reporter: Jeremy Hanna
> Assignee: Roman Pogribnyi
> Priority: Minor
> Labels: lhf
> Fix For: 3.x
>
> Attachments: 10120-3.0.txt
>
>
> Right now if both initial_token and num_tokens are specified, initial_token
> is used. As something to not trip people up, it would be nice to do a basic
> error check. If both are specified, we should make sure they match. That
> is, if they have one initial token and num_tokens of 256, it should error out
> on startup and alert the user of the configuration. It's better to fail fast
> than bootstrap with only one token.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)