From bcb06bb043d10a975ba4c49decb754e6839bca13 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Tue, 19 Dec 2017 16:35:16 +0100 Subject: [PATCH] flat_mutation_reader: Fix make_nonforwardable() It emitted end-of-stream prematurely if buffer was full. Message-Id: <1513697716-32634-1-git-send-email-tgrabiec@scylladb.com> (cherry picked from commit 6a6bf58b983f15a4afc910da70b16d4785313682) --- flat_mutation_reader.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flat_mutation_reader.cc b/flat_mutation_reader.cc index d6f7b37ba1..0b413860de 100644 --- a/flat_mutation_reader.cc +++ b/flat_mutation_reader.cc @@ -381,7 +381,10 @@ flat_mutation_reader make_nonforwardable(flat_mutation_reader r, bool single_par virtual future<> fill_buffer() override { return do_until([this] { return is_end_of_stream() || is_buffer_full(); }, [this] { return fill_buffer_from(_underlying).then([this] (bool underlying_finished) { - return on_end_of_underlying_stream(); + if (underlying_finished) { + return on_end_of_underlying_stream(); + } + return make_ready_future<>(); }); }); }