sstables: do not call consume_end_partition() after proceed::no

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 <pdziepak@scylladb.com>
Message-Id: <1471943032-7290-1-git-send-email-pdziepak@scylladb.com>
This commit is contained in:
Paweł Dziepak
2016-08-23 10:03:52 +01:00
committed by Avi Kivity
parent 9d1d8baf37
commit 5feed84e32
Notes: Avi Kivity 2016-08-23 12:25:20 +03:00
backport: 1.3

View File

@@ -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<unconsumed_remainder>(std::move(data));