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

Eduard Tudenhoefner commented on CASSANDRA-13533:
-------------------------------------------------

[~jjirsa] we were using that flag in some of our integration tests where we 
found out that, _very rarely_, simple things (usually taking < 1 second) would 
take a long amount of time (> 30 seconds). 

We boiled it then down to the point where we saw that this time was 99% spent 
in the prepared stmt cache for adding/evicting elements. And in our case, 
eviction was happening because a single prepared stmt would account *1mb - 6mb* 
(prep stmt cache size was *8mb* for us). After looking closer why prep stmts 
would be so large, we eventually saw that the binary representation of 
{{ColumnIdentifier#text}} was be wrong and not what we would have expected (see 
attached screenshot).

We also only detected all of this because on *cassandra-3.0* we don't use 
*.omitSharedBufferOverhead()* with {{MemoryMeter}} object measurements ( 
[QueryProcessor.java#L67|https://github.com/apache/cassandra/blob/cassandra-3.0/src/java/org/apache/cassandra/cql3/QueryProcessor.java#L67]).
 
On *cassandra-3.11* things got refactored over time and the prep stmt cache was 
using {{MemoryMeter}} stuff from {{ObjectSizes}}, where 
*.omitSharedBufferOverhead()* is being applied and the issue wouldn't happen 
([ObjectSizes.java#L35|https://github.com/apache/cassandra/blob/cassandra-3.11/src/java/org/apache/cassandra/utils/ObjectSizes.java#L35]).



> ColumnIdentifier object size wrong when tables are not flushed
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-13533
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13533
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Eduard Tudenhoefner
>            Assignee: Eduard Tudenhoefner
>             Fix For: 3.0.14, 3.11.0, 4.0
>
>         Attachments: columnidentifier.png
>
>
> It turns out that the object size of {{ColumnIdentifier}} is wrong when 
> *cassandra.test.flush_local_schema_changes: false*. This looks like stuff is 
> being wrongly reused when no flush is happening.
> We only noticed this because we were using the prepared stmt cache and 
> noticed that prepared statements would account for *1-6mb* when 
> *cassandra.test.flush_local_schema_changes: false*. With 
> *cassandra.test.flush_local_schema_changes: true* (which is the default) 
> those would be around *5000 bytes*.
> Attached is a test that reproduces the problem and also a fix.
> Also after talking to [~jkni] / [~blerer] we shouldn't probably take 
> {{ColumnDefinition}} into account when measuring object sizes with 
> {{MemoryMeter}}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to