cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulo Motta (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-10120) When specifying both num_tokens and initial_token, error out if the numbers don't match
Date Mon, 07 Mar 2016 20:49:40 GMT


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):
ERROR [MemtableFlushWriter:1] 2016-03-07 17:41:14,342 - Exception
in thread Thread[MemtableFlushWriter:1,5,main]
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
        at java.util.ArrayList.rangeCheck( ~[na:1.8.0_66]
        at java.util.ArrayList.get( ~[na:1.8.0_66]
        at org.apache.cassandra.dht.Splitter.splitOwnedRangesNoPartialRanges(
        at org.apache.cassandra.dht.Splitter.splitOwnedRanges( ~[main/:na]
        at org.apache.cassandra.service.StorageService.getDiskBoundaries(
        at org.apache.cassandra.db.Memtable.createFlushRunnables( ~[main/:na]
        at org.apache.cassandra.db.Memtable.flushRunnables( ~[main/:na]
        at org.apache.cassandra.db.ColumnFamilyStore$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$
        at ~[na:1.8.0_66]

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:
>             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

View raw message