Skip to content

Commit

Permalink
storage_proxy: query_partition_key_range_concurrent: maybe_yield in loop
Browse files Browse the repository at this point in the history
Add calls to `maybe_yield` in the per-range loops to
prevent stalls caused by query_partition_key_range_concurrent
nested calls when it never yields.

Fixes scylladb#14008

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
  • Loading branch information
bhalevy committed Jul 31, 2023
1 parent 8d5020b commit e71e5d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions service/storage_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5573,6 +5573,8 @@ storage_proxy::query_partition_key_range_concurrent(storage_proxy::clock_type::t
std::vector<dht::token_range> merged_ranges{to_token_range(range)};
++i;

co_await coroutine::maybe_yield();

// getRestrictedRange has broken the queried range into per-[vnode] token ranges, but this doesn't take
// the replication factor into account. If the intersection of live endpoints for 2 consecutive ranges
// still meets the CL requirements, then we can merge both ranges into the same RangeSliceCommand.
Expand Down Expand Up @@ -5674,6 +5676,7 @@ storage_proxy::query_partition_key_range_concurrent(storage_proxy::clock_type::t
filtered_endpoints = std::move(filtered_merged);
++i;
merged_ranges.push_back(to_token_range(next_range));
co_await coroutine::maybe_yield();
}
}
slogger.trace("creating range read executor for range {} in table {}.{} with targets {}",
Expand Down

0 comments on commit e71e5d3

Please sign in to comment.