Stop Iterator re-use

The IMM iterator should not be reused, as it has already been filtered for a query.  so if reused for a different query incorrect and unexpected results may occur.

This reuse had been stopped by a previous commit, and this cleans up subsequently unused code.
This commit is contained in:
Martin Sumner 2018-03-02 08:16:34 +00:00
parent d21d18dd82
commit 5312806592

View file

@ -1273,15 +1273,6 @@ keyfolder({[{IMMKey, IMMVal}|NxIMMiterator], SSTiterator},
{SegmentList, MaxKeys}) ->
{StartKey, EndKey} = KeyRange,
case {IMMKey < StartKey, leveled_codec:endkey_passed(EndKey, IMMKey)} of
{true, _} ->
% Normally everything is pre-filterd, but the IMM iterator can
% be re-used and so may be behind the StartKey if the StartKey has
% advanced from the previous use
keyfolder({NxIMMiterator, SSTiterator},
KeyRange,
{AccFun, Acc},
{SegmentList, MaxKeys});
{false, true} ->
% There are no more keys in-range in the in-memory
% iterator, so take action as if this iterator is empty