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

Benedict commented on CASSANDRA-14649:
--------------------------------------

I think this patch is also broken.

Previously, the logical trim invoked {{setCapacity(length())}}, which I can see 
is buggy for a size > 2GiB (but is otherwise consistent).  Now, it seems to be 
invoking {{setCapacity(capacity())}}, which is surely a no-op?

It seems that there's a bunch of bugs here, and that really we should be:
# fix {{length}} to work for sizes > 2GiB
# implement {{trim}} as {{resizeTo(length())}}
# rename {{reallocate}} to something like {{ensureCapacity}}, to avoid this 
kind of misuse mistake in future



> Index summaries fail when their size gets > 2G and use more space than 
> necessary
> --------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-14649
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14649
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Branimir Lambov
>            Assignee: Branimir Lambov
>            Priority: Major
>
> After building a summary, {{IndexSummaryBuilder}} tries to trim the memory 
> writers by calling {{SafeMemoryWriter.setCapacity(capacity())}}. Instead of 
> trimming, this ends up allocating at least as much extra space and failingĀ 
> the {{Buffer.position()}} call when the size is greater than 
> {{Integer.MAX_VALUE}}.



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