From 6528f3a963f3a821cbfad58d367e56ef50fe7dfd Mon Sep 17 00:00:00 2001 From: Piotr Jastrzebski Date: Wed, 24 May 2017 17:29:05 +0200 Subject: [PATCH] Make sure mutation_reader for sstables can be fast-forwarded Fixes #2145. Signed-off-by: Piotr Jastrzebski [tgrabiec: Extracted from a series, fixed title] Message-Id: <1495639745-19387-1-git-send-email-tgrabiec@scylladb.com> --- sstables/partition.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sstables/partition.cc b/sstables/partition.cc index 6e8db611ce..efccb35164 100644 --- a/sstables/partition.cc +++ b/sstables/partition.cc @@ -1105,7 +1105,15 @@ public: } future<> fast_forward_to(const dht::partition_range& pr) { - return _ds->fast_forward_to(pr); + if (_ds) { + return _ds->fast_forward_to(pr); + } + return (_get_data_source)().then([this, &pr] (lw_shared_ptr ds) { + // We must get the sstable_data_source and backup it in case we enable read + // again in the future. + _ds = std::move(ds); + return _ds->fast_forward_to(pr); + }); } };