Brad Schoening created CASSANDRA-21139:
------------------------------------------
Summary: Guardrail for miss-prepared statements
Key: CASSANDRA-21139
URL: https://issues.apache.org/jira/browse/CASSANDRA-21139
Project: Apache Cassandra
Issue Type: Improvement
Components: Feature/Guardrails
Reporter: Brad Schoening
We have hundreds of application teams and several dozen of them miss-prepare
statements by using literals instead of bind markers.
I.e.,
{code:sql}
// using
select * from users where ID = 999
// instead of
select * from users where ID = ?
{code}
The problem causes the prepared statement cache to overflow, and will print a
prepared statements discarded WARN message in the Cassandra log. At present,
we use a wack-a-mole approach to discuss the problem with each team
individually, and hope they fix it and train the entire team on how to prepare
statements correctly.
Also, finding the root cause of the issue today requires having the knowledge
and access to look at the system.prepared_statements table.
Guardrails would seem a good approach here, where the guard could WARN or
REJECT when a statement was prepared using a WHERE clause and no bind markers.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]