From 1f644df09ddbf747eae9c4f6d52d497589caf776 Mon Sep 17 00:00:00 2001 From: Piotr Jastrzebski Date: Mon, 12 Apr 2021 21:08:40 +0200 Subject: [PATCH] cache_flat_mutation_reader: fix do_fill_buffer Make sure that when a partition does not exist in underlying, do_fill_buffer does not try to fast forward withing this nonexistent partition. Test: unit(dev) Fixes #8435 Fixes #8411 Signed-off-by: Piotr Jastrzebski --- cache_flat_mutation_reader.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cache_flat_mutation_reader.hh b/cache_flat_mutation_reader.hh index 818a43e26a..cbcad7f2e2 100644 --- a/cache_flat_mutation_reader.hh +++ b/cache_flat_mutation_reader.hh @@ -267,6 +267,9 @@ future<> cache_flat_mutation_reader::do_fill_buffer(db::timeout_clock::time_poin } _state = state::reading_from_underlying; _population_range_starts_before_all_rows = _lower_bound.is_before_all_clustered_rows(*_schema); + if (!_read_context->partition_exists()) { + return read_from_underlying(timeout); + } auto end = _next_row_in_range ? position_in_partition(_next_row.position()) : position_in_partition(_upper_bound); return _underlying->fast_forward_to(position_range{_lower_bound, std::move(end)}, timeout).then([this, timeout] {