storage_proxy: Send page_size in the read_command

When the whole cluster is already supporting
separate_page_size_and_safety_limit,
start sending page_size in read_command. This new value will be used
for determining the page size instead of hard_limit.

Fixes #9487
Fixes #7586

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
This commit is contained in:
Piotr Jastrzebski
2021-12-16 17:50:39 +01:00
parent 02d5997377
commit 7fa3fa6e65

View File

@@ -1348,12 +1348,13 @@ endpoints_to_replica_ids(const locator::token_metadata& tm, const inet_address_v
}
query::max_result_size storage_proxy::get_max_result_size(const query::partition_slice& slice) const {
// Unpaged and reverse queries.
// FIXME: some reversed queries are no longer unlimited.
// To filter these out we need to know if it's a single partition query.
// Take the partition key range as a parameter? This would require changing many call sites
// where the partition key range is not immediately available.
// For now we ignore the issue, return the 'wrong' limit for some reversed queries, and wait until all reversed queries are fixed.
if (_features.cluster_supports_separate_page_size_and_safety_limit()) {
auto max_size = _db.local().get_unlimited_query_max_result_size();
return query::max_result_size(max_size.soft_limit, max_size.hard_limit, query::result_memory_limiter::maximum_result_size);
}
// FIXME: Remove the code below once SEPARATE_PAGE_SIZE_AND_SAFETY_LIMIT
// cluster feature is released for more than 2 years and can be
// retired.
if (!slice.options.contains<query::partition_slice::option::allow_short_read>() || slice.options.contains<query::partition_slice::option::reversed>()) {
return _db.local().get_unlimited_query_max_result_size();
} else {