Skip to content
Snippets Groups Projects
Commit 330d53f0 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Roman Tsisyk
Browse files

vinyl: fix read source restore after statement removal

Suppose, a source iterator was positioned at the minimal statement
across all sources before yielding to read a disk source. Then it has
front_id equal to the front_id of the read iterator, which indicates
that the source iterator needs to be advanced on the next iteration.
However, if the statement was removed during the yield, the iterator
gets repositioned on the next statement by the restoration procedure
(see vy_read_iterator_next_key()). In this case it isn't positioned on
the minimal statement any more and hence must not be advanced on the
next iteration, but its front_id remains the same, which means it will
be advanced, possibly skipping a statement.

The situation described above can happen only in case of the tuple
cache, because other sources are append-only. Obviously, to avoid this
kind of trouble, we must reset the front_id if a source iterator is
restored to a statement that is greater than the minimal statement.
parent a2a82803
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment