[
https://issues.apache.org/jira/browse/CASSANDRA-19986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17929288#comment-17929288
]
Andy Tolbert commented on CASSANDRA-19986:
------------------------------------------
also possibly relevant to this is CASSANDRA-19703 where it's observed that the
version of caffeine that 4.0 and 4.1 uses will eagerly evict a prepared
statement from the cache as soon as it is inserted. This causes a leak of
statements in system.prepared_statements, but the eager eviction of the
statement will likely cause a lot of reprepare logic. I've added a proposed
change to that issue which addresses the system table leak, but doesn't stop
the eager eviction (still need to think on that).
> Prepared statements cache computation improvements
> --------------------------------------------------
>
> Key: CASSANDRA-19986
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19986
> Project: Apache Cassandra
> Issue Type: Improvement
> Components: Legacy/CQL
> Reporter: Berenguer Blasi
> Assignee: Berenguer Blasi
> Priority: Normal
> Fix For: 4.0.15, 4.1.8, 5.0.3, 5.1
>
> Attachments: screenshot-1.png
>
>
> Currently prepared statements size are computed twice which is duplicate
> effort:
> -
> [https://github.com/apache/cassandra/blob/cassandra-4.0/src/java/org/apache/cassandra/cql3/QueryProcessor.java#L672]
> -
> [https://github.com/apache/cassandra/blob/cassandra-4.0/src/java/org/apache/cassandra/cql3/QueryProcessor.java#L802]
> But we also get the side effect of that 'slow' computation locking the
> underlying ConcurrentHashMap. We've had nodes becoming unresponsively slow
> for hours with hundreds of threads in jstack all queued up behind
> {{computeIfAbsent}} operations on cache insertion/eviction collisions.
> Computing size only once and pulling that value instead of recomputing it on
> cache insertion was the solution
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]