From 5feed84e32df8427ab1dff2050f79e964335c8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dziepak?= Date: Tue, 23 Aug 2016 10:03:52 +0100 Subject: [PATCH] sstables: do not call consume_end_partition() after proceed::no MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After state_processor().process_state() returns proceed::no the upper layer should have a chance to act before more data is pushed to the consumer. This means that in case of proceed::no verify_end_state() should not be called immediately since it may invoke consume_end_partition(). Fixes #1605. Signed-off-by: Paweł Dziepak Message-Id: <1471943032-7290-1-git-send-email-pdziepak@scylladb.com> --- sstables/consumer.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sstables/consumer.hh b/sstables/consumer.hh index 184d6fb672..aff54da21b 100644 --- a/sstables/consumer.hh +++ b/sstables/consumer.hh @@ -262,10 +262,10 @@ public: // We received more data than we actually care about, so process // the beginning of the buffer, and return the rest to the stream auto segment = data.share(0, _remain); - process(segment); + auto ret = process(segment); data.trim_front(_remain - segment.size()); _remain -= (_remain - segment.size()); - if (_remain == 0) { + if (_remain == 0 && ret == proceed::yes) { verify_end_state(); } return make_ready_future(std::move(data));