tolbertam commented on code in PR #3917:
URL: https://github.com/apache/cassandra/pull/3917#discussion_r2040864803
##########
src/java/org/apache/cassandra/cql3/QueryProcessor.java:
##########
@@ -155,6 +155,12 @@ private enum InternalStateInstance
}
public void preloadPreparedStatements()
+ {
+ preloadPreparedStatements(5000);
Review Comment:
I added something for this that logs when we exceed
`QueryProcessor.PRELOAD_PREPARED_STATEMENTS_MAX` (1 million).
I thought a little bit more about how I would have wanted this to work, and
rather than having it just log and continue plugging away for hours or days,
that we just short circuit and stop reading after an excessive amount of rows.
> WARN [main] 2025-04-12 20:17:30,536 SystemKeyspace.java:1893 - Preloaded
250 prepared statements. This could be an indication that prepared statements
leaked prior to CASSANDRA-19703 being fixed. Returning early to prevent
indefinite startup. Consider truncating system.prepared_statements to clear
out leaked prepared statements.
The up side here is no user intervention is needed here unless one *really*
wants the optimization of prepared statements being preloaded on startup. If
one gets into this situation where you have leaked over 1 million prepared
statements, it's likely the operator wasn't aware that they hadn't benefitted
from this functionality for quite some time and that misconfigurations in
application code had caused a lot of unique prepared statements.
The downside is that the prepared statement table may eventually never be
drained without user intervention. But I consider this a better tradeoff than
nodes not starting after hours or days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]