Merge branch 'cassandra-4.1' into cassandra-5.0

* cassandra-4.1:
  Avoid computing prepared statement size for unprepared batches
This commit is contained in:
Caleb Rackliffe 2025-04-15 22:58:43 -05:00
commit 7d93089a1e
3 changed files with 11 additions and 2 deletions

View File

@ -3,6 +3,7 @@
* Fixed multiple single-node SAI query bugs relating to static columns (CASSANDRA-20338)
* Upgrade com.datastax.cassandra:cassandra-driver-core:3.11.5 to org.apache.cassandra:cassandra-driver-core:3.12.1 (CASSANDRA-17231)
Merged from 4.0:
* Avoid computing prepared statement size for unprepared batches (CASSANDRA-20556)
* Fix Dropwizard Meter causes timeouts when infrequently used (CASSANDRA-19332)

View File

@ -417,6 +417,11 @@ public class QueryProcessor implements QueryHandler
}
public static Prepared parseAndPrepare(String query, ClientState clientState, boolean isInternal) throws RequestValidationException
{
return parseAndPrepare(query, clientState, isInternal, true);
}
public static Prepared parseAndPrepare(String query, ClientState clientState, boolean isInternal, boolean measure) throws RequestValidationException
{
CQLStatement.Raw raw = parseStatement(query);
@ -441,7 +446,10 @@ public class QueryProcessor implements QueryHandler
res = new Prepared(statement, "", fullyQualified, keyspace);
else
res = new Prepared(statement, query, fullyQualified, keyspace);
res.pstmntSize = measurePstmnt(res);
// Some prepared statements will not be cached and therefore do not require a pre-computed size.
if (measure)
res.pstmntSize = measurePstmnt(res);
return res;
}

View File

@ -188,7 +188,7 @@ public class BatchMessage extends Message.Request
{
p = QueryProcessor.parseAndPrepare((String) query,
state.getClientState().cloneWithKeyspaceIfSet(options.getKeyspace()),
false);
false, false);
}
else
{