readers/multishard: implement the read_ahead flag

Don't do read-aheads when read-ahead was not enabled.
This commit is contained in:
Botond Dénes
2024-09-20 02:57:23 -04:00
parent 8938e06ebe
commit 36a8756028

View File

@@ -1104,7 +1104,7 @@ future<> multishard_combining_reader_v2::handle_empty_reader_buffer() {
// If we crossed shards and the next reader has an empty buffer we
// double concurrency so the next time we cross shards we will have
// more chances of hitting the reader's buffer.
if (_crossed_shards) {
if (_crossed_shards && _read_ahead == read_ahead::yes) {
_concurrency = std::min(_concurrency * 2, _sharder.shard_count());
// Read ahead shouldn't change the min selection heap so we work on a local copy.