You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jacek Lewandowski (Jira)" <ji...@apache.org> on 2022/11/03 15:43:00 UTC

[jira] [Updated] (CASSANDRA-18013) Splitter sometimes creates different number of splits than requested

     [ https://issues.apache.org/jira/browse/CASSANDRA-18013?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacek Lewandowski updated CASSANDRA-18013:
------------------------------------------
    Fix Version/s: 4.1
                   4.2
                   4.x

> Splitter sometimes creates different number of splits than requested
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-18013
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18013
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Local/Compaction
>            Reporter: Jacek Lewandowski
>            Assignee: Jacek Lewandowski
>            Priority: Normal
>             Fix For: 4.1, 4.2, 4.x
>
>
> {{Splitter}} in some cases may produce one split more than requested. When it happens, it  fails with assertion error when assertions are enabled.
> Test to reproduce the issue:
> {code:java}
>         Splitter splitter = getSplitter(Murmur3Partitioner.instance);
>         long lt = 0;
>         long rt = 31;
>         Range<Token> range = new Range<>(getWrappedToken(Murmur3Partitioner.instance, BigInteger.valueOf(lt)),
>                                          getWrappedToken(Murmur3Partitioner.instance, BigInteger.valueOf(rt)));
>         for (int i = 1; i <= (rt - lt); i++)
>         {
>             List<Token> splits = splitter.splitOwnedRanges(i, Arrays.asList(new Splitter.WeightedRange(1.0d, range)), false);
>             logger.info("{} splits of {} are: {}", i, range, splits);
>             Assertions.assertThat(splits).hasSize(i);
>         }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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