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

vinyl: don't advance read iterator pos after restore to min key

If the iterator over a merge source was restored to a newer version of
the min key, we must not increment front_id, otherwise the source won't
be advanced on the next iteration, potentially resulting in the same key
returned twice by vy_merge_iterator_next_key(). In the long run, this is
likely to break the cache. Fix this and add an assert() checking that it
never happens.

While we are at it, remove loop from vy_read_iterator_merge_next_key()
that checks that the statement returned by vy_merge_iterator_next_key()
isn't the same as the statement returned to the user last time. The loop
condition should never evaluate to true, which is assured by the new
assert().

Fixes: 61ffe793 ("vinyl: fix read iterator restoration to a newer
version of the same key").
parent 008658b3
No related branches found
No related tags found
Loading
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