stargate / data-api

JSON document API for Apache Cassandra (formerly known as JSON API)
https://stargate.io
Apache License 2.0
14 stars 16 forks source link

Configurable CQL query timeouts by query type #783

Closed jeffreyscarpenter closed 9 months ago

jeffreyscarpenter commented 9 months ago

Currently the JSON API only supports a single configurable value for CQL query timeouts, which defaults to 10s in the standard config file that is checked in.

At high scale usage in cloud environments, we've observed the need for more flexible controls for different types of queries. For example, DDL queries like create/delete table have different behavior and can take longer in cloud environments.

JSON API can make use of the execution profile feature offered by the CQL in order to create profiles for each type of query, with separate timeouts for each profile. This will allow users to have more flexible control over timeouts with a simple config file change.

Suggested profiles:

jeffreyscarpenter commented 9 months ago

We might also be able to use a count profile to disable CQL warning logs for COUNT statements only, to get rid of these annoying log messages

Query '[0 values] SELECT COUNT(1) AS count FROM my_namespace.my_collection' generated server side warning(s): Aggregation query used without partition key