Allow setting read timeout on the query level for UDA queries
Description
With the release of Cassandra 2.2 and 3.0, we can now use User Defined Aggregates (UDA) to perform aggregation queries directly in Cassandra.
However, the current settings of read timeout (12 secs) as well as its global scope is not suitable for UDA. Indeed, 12 secs is a very large limit for real time OLTP queries but may not be sufficient enough for aggregation queries that need to fetch millions of rows server-side.
Most of the time, an aggregation query fails because the query duration exceeds the read timeout value.
Setting this timeout to a huge value like 200secs may not be a good decision for OLTP queries.
It will be easier if we can set the read timeout on the query level.
Resolution: added Statement.setReadTimeoutMillis
Environment
None
Pull Requests
None
Activity
Show:
Olivier Michallat
January 14, 2016 at 3:03 PM
Also, it's worth noting that the server-side timeout has different semantics for UDA queries. From this conversation:
when executing aggregation functions, Cassandra will use paging internally, so at most one page worth of data will be held in memory at a time ... Timeouts for these queries should be adjusted accordingly. It's worth noting that the read_request_timeout_in_ms setting applies per-page
With the release of Cassandra 2.2 and 3.0, we can now use User Defined Aggregates (UDA) to perform aggregation queries directly in Cassandra.
However, the current settings of read timeout (12 secs) as well as its global scope is not suitable for UDA. Indeed, 12 secs is a very large limit for real time OLTP queries but may not be sufficient enough for aggregation queries that need to fetch millions of rows server-side.
Most of the time, an aggregation query fails because the query duration exceeds the read timeout value.
Setting this timeout to a huge value like 200secs may not be a good decision for OLTP queries.
It will be easier if we can set the read timeout on the query level.
Resolution: added
Statement.setReadTimeoutMillis